import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;
public class zhang extends Applet {
int x,y; //圆的位置
int W_H; //圆的大小
int R,G,B; //圆的颜色
Random rd = new Random();
public void init(){
this.resize(400, 300);
}
public void paint(Graphics g){
while ( true ){
W_H = rd.nextInt(100);
x = rd.nextInt(this.getWidth());
y = rd.nextInt(this.getHeight());
R = rd.nextInt(255);
G = rd.nextInt(255);
B = rd.nextInt(255);
g.setColor(Color.white);
g.fillRect(0,0,this.getWidth(),this.getHeight());
Color color = new Color(R,G,B);
g.setColor(color);
g.fillArc(x,y,W_H,W_H,0,360);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}