Answer:

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 JApplet
{
  Circle circ = new Circle( 100, 100, 25 );

  public void paint ( Graphics gr )
  { 
    circ.draw( gr );    
  }
}

HTML Page

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

<html>
<body>
<applet code="TestCircle.class"  width="200" height="200">
</applet>
</body>
</html>

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 paint() method of the applet is called whenever the Web browser needs to paint the section of the screen reserved for the applet. To see that happen, reduce the size of your browser's window, then drag it around. On some computer systems you will see the applet's drawing area flicker as paint() repeatedly is called to redraw the area.

QUESTION 7:

How would you make the test applet draw more circles?