//FlashingCircles.java import java.awt.Graphics; import java.awt.Color; import javax.swing.*; public class FlashingCircles extends JApplet { public void paint( Graphics g ) { int x1, y1, width, height; super.paint( g ); //assumes screen area is 800x800 while (true) { x1 = (int)(Math.random() * 800); y1 = (int)(Math.random() * 600); width = (int)(Math.random() * 200); height = (int)(Math.random() * 200); g.setColor(new Color((int)(Math.random()*256),(int)(Math.random()*256), (int)(Math.random()*256))); g.fillOval(x1,y1,width,height); //time waste loop for (int i=0; i<100000; i++) Math.sqrt(i); } } }