//shoot colored lines out of the center of the screen
import java.awt.*;
//import javax.swing.*;

public class secondprogram extends java.applet.Applet {
	public void init() {
		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 xto, yto;
		int xcenter = xsize/2;
		int ycenter = ysize/2;
		int radius = xcenter-1; //take the lesser of the half-screen width or height.
		if (ycenter < xcenter) {
			radius = ycenter-1;
		}
		for (int i=0; i<2000; i++) {
			xto = xcenter + (int)(radius*Math.cos(6.28318530718*Math.random()));
			yto = ycenter + (int)(radius*Math.sin(6.28318530718*Math.random()));
			Color c=new Color((int)(Math.random()*255), (int)(Math.random()*255), (int)(Math.random()*255));
//			Color c=new Color((int)(Math.random()*255), (int)(Math.random()*255), (int)(Math.random()*255));

			comp2d.setColor(c);
			comp2d.drawLine(xcenter, ycenter, xto, yto); //draw from where you drew last
		}
	}
}

