import java.applet.Applet; |
import java.awt.Color; |
import java.awt.Graphics; |
public class Exercise4d extends Applet{ |
public void paint(Graphics g) |
{ |
int x,y; |
x= 400 ; |
y= 400 ; |
|
int s= 400 ; |
for ( int n= 0 ;n< 5 ;n++){ |
if (n% 2 == 0 ){ |
g.setColor( new Color( 161 , 55 , 143 )); |
g.fillOval(x-s, y-s, s* 2 , s* 2 );} |
else |
g.setColor( new Color( 250 , 250 , 250 )); |
|
|
g.fillOval(x-s, y-s, s* 2 , s* 2 ); |
|
|
s=s- 50 ; |
} |
|
|
g.setColor( new Color( 25 , 250 , 250 )); |
|
|
g.fillOval(x-s, y-s, s* 2 , s* 2 ); |
|
|
|
} |
} |
|
|
|
|
|