Giovedi' 22 Maggio 2003 : 10 59 4 - Anonimo da sele25.fisica.uniba.it 193.204.188.202

import java.awt.*;
import javax.swing.*;
public class Cerchio extends JApplet {
Disegno a;
int n;
public void init(){
a = new Disegno();
setContentPane(a);
n = (int)(Math.random()*100);
System.out.println(" n " + n);
a.repaint();
}
class Disegno extends JPanel {
public void paintComponent(Graphics g){
for(int i = 0;i<n;i++){
g.setColor(new Color(
(int)(Math.random()*255),
(int)(Math.random()*255),
(int)(Math.random()*255))
);
g.fillOval((int)(Math.random()*300),
(int)(Math.random()*500),
(int)(Math.random()*300),
(int)(Math.random()*500));
}
}
}
}