
(mine is the one with just 2 circles). I'm trying to achieve what the other looks like.
public void draw(Graphics g)
{
//largest
int x = centerX - radius;
int y = centerY - radius;
int width = 2 * radius;
int height = 2 * radius;
Color myColor = new Color(0, 0, 255);
g.setColor(myColor);
g.fillOval(x, y, width, height);
//2nd
int secondX = centerX - radius/2;
int secondY = centerY - radius/2;
int secondWidth = radius ;
int secondHeight = radius;
g.setColor(Color.WHITE);
g.fillOval(secondX, secondY, secondWidth, secondHeight);
I know I'm messing up in the secondWidth and height, but I'm confused about how to fix it. How would I make it so that the size of smaller circles increments down like the picture?

New Topic/Question
Reply



MultiQuote





|