Lab 9. Problem 3.

Graphic User Interfaces. Applets

  1. Write an applet that draws a target formed from concentric circles of different colors, like in the following figure:

The diameter of greatest circle is equal with the maximum between the width and height of the applet. The diameter of next circle is smaller with the value of a parameter than the first circle.  And so on. The value of the parameter will be read from the associated html file of the applet.

The colors of circles will be randomly generated using the static method random() of the class Math.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. Modify the previous program such that the target is redrawn at regulated time intervals, like here.

 

Hint. The value of the time interval will be specified as a parameter in the html file which includes the applet, like this:

<PARAM  NAME="time" VALUE="300"> where the value represents 300 milliseconds.