A good answer might be:

You put the circle anyplace you want and make it any radius. The following seems like a reasonable choice to me:

public class testCircle extends Applet
  Circle circ = new Circle( 100, 100, 25 );

  public void paint ( Graphics gr )

    circ.draw( gr );    


To run the test applet a Web page is needed, perhaps called testCircle.html:

<applet code="testCircle.class"  width="200" height="200">

The source file is compiled in the usual way and run with the appletviewer:

C:\>javac testCircle.java
C:\>appletviewer testCircle

(Or you can look at testCircle.html with a Web browser.) Here is what the test applet draws:

The method paint() of the applet is called whenever the Web browser needs to paint the 200 by 200 section of the screen reserved for the applet. You can see happening in the Web browser you are currently using. Make the Web browser about half the size of the full screen, then drag it around. You might see the applet's drawing area flickering as paint() repeatedly is called to redraw the area.


How would you make the test applet draw more circles?