public Circle( int x, int y, int radius ) { this.x = x; this.y = y; this.radius = radius; }
There must be a drawing method.
The draw()
drawOval(int x, int Y, int width, int height)
The method must be told on which drawing area to draw a
circle, so the draw method has a single parameter
for the Graphics
object of the applet.
If you know the center of the circle, (x, y) and radius, you can calculate the coordinates of the upperleft corner of the square that contains the circle, and its width and height. Here is a picture to help:
Fill in the blanks of the above method.