import java.lang.Math;
public class MyTest2{
public static void main(String[] args){
Frame w = new Frame();
w.setSize(1024,768);
w.setBackground(Color.BLACK);
MyPanel2 mp = new MyPanel2();
w.add(mp);
w.show();
}
}
class MyPanel2 extends Panel{
public void paint(Graphics g){
g.setColor(Color.WHITE);
for(int i = 0 ; i < 300; i++){
g.drawString("*", (int)(Math.random()*1024),
(int)(Math.random()*768));
}
}
}