//RandomLines.java import java.awt.Graphics; import javax.swing.*; public class RandomLines extends JApplet { public void paint( Graphics g ) { int x1, y1, x2, y2; super.paint( g ); //assumes screen area is 800x800 while (true) { x1 = (int)(Math.random() * 800); y1 = (int)(Math.random() * 800); x2 = (int)(Math.random() * 800); y2 = (int)(Math.random() * 800); g.drawLine(x1,y1,x2,y2); } } }