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:
| |
HTML PageTo run the test applet a web page is needed, perhaps called testCircle.html: The source file is compiled in the usual way and run with the appletviewer:<html> <body> <applet code="testCircle.class" width=200 height=200> </applet> </body> </html> (Or you can look at testCircle.html with a web browser.) Here is what the test applet draws:C:\>javac testCircle.java C:\>appletviewer testCircle
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. | |
QUESTION 7:How would you make the test applet draw more circles? Click Here after you have answered the question |