//draw random lines all over the screen
import java.awt.*;
//import javax.swing.*;

public class firstprogram extends java.applet.Applet {
	public void init() {
		//Color background = new Color(0, 0, 0);
		setBackground(Color.black);
	}
	
	public void paint(Graphics screen) {
		Graphics2D comp2d = (Graphics2D)screen;
		Dimension appletSize = this.getSize();
    	int xsize = appletSize.width;
    	int ysize = appletSize.height;
		int x, y;
		int xto = (int)((xsize-1)*Math.random());
		int yto = (int)((ysize-1)*Math.random());
		for (int i=0; i<2000; i++) {
			x = xto;
			y = yto;
			xto = (int)((xsize-1)*Math.random());
			yto = (int)((ysize-1)*Math.random());
			Color c=new Color((int)(Math.random()*255), (int)(Math.random()*255), (int)(Math.random()*255));
			comp2d.setColor(c);
			comp2d.drawLine(x, y, xto, yto); //draw from where you drew last
		}
	}
}

