for(int r=25;r<=125;r+=25) { int color = 1; switch(color) { case 1 : g.setColor(Color.black); Expo.fillCircle(g,625,175,r); color++; break; case 2 : g.setColor(Color.white); Expo.fillCircle(g,625,175,r); color++; break; case 3 : g.setColor(Color.blue); Expo.fillCircle(g,625,175,r); color++; break; case 4 : g.setColor(Color.red); Expo.fillCircle(g,625,175,r); color++; break; case 5 : g.setColor(Color.yellow); Expo.fillCircle(g,625,175,r); color++; break; } } g.setColor(Color.black); //reset colors.
I am attempting to draw 5 concentric circles with increasing radius and chose the colors that each circle is filled with via a switch of an int. The result is a circle of maximus radius (which would indicate that the for loop is working, right?), but it is all the same color, the color of black which is case 1. What am I doing wrong, why won't the other circles change colors?