// An applet with classes that draw shapes.
import java.awt.*;
import java.applet.Applet;
public class Circles extends Applet
{
private CircularFigure circle;
public void paint (Graphics g)
{
for (int count
= 0; count < 10; count ++)
{
circle = new CircularFigure (Color.red, 100, 20*count, 30);
circle.displayCircle (g);
}
} // method paint
} // class Circles
// A class that can display a rectangle.
class CircularFigure
{
private Color circleColor;
private int x, y, diameter;
CircularFigure (Color color, int xValue, int
yValue, int d)
{
circleColor
= color;
x = xValue;
y = yValue;
diameter = d;
} // constructor
public void displayCircle (Graphics g)
{
g.setColor (circleColor);
g.fillOval (x,
y, diameter, diameter);
} // method displayCircle
} // class CircularFigure