int numCircles;
stopValue = 1;
counter = (int)(Math.random() * 15 + 1);
numCircles = counter;
xCoord = xCoord - counter * (change / 2);
yCoord = yCoord - counter * (change / 2);
while (counter >= stopValue)
{
diameter = counter * change;
if (counter % 2 == 0)
{
g.setColor(Color.blue);
}
else
{
g.setColor(Color.red);
}
g.fillOval(xCoord, yCoord, diameter, diameter);
counter = counter - 1;
xCoord = xCoord + change / 2;
yCoord = yCoord + change / 2;
}
g.drawString(numCircles + " Nice circles", change, counter * diameter + change);