//Starburst.java //randomly colored lines randomly from center of applet import java.awt.*; import javax.swing.*; public class Starburst extends JApplet { int lines; public void init() { String input; input = JOptionPane.showInputDialog( "Enter number of lines to create" ); lines = Integer.parseInt( input ); } public void paint (Graphics g) { for (int i=1; i<=lines; i++) { g.setColor(new Color((int)(Math.random()*256), (int)(Math.random()*256), (int)(Math.random()*256))); g.drawLine(getWidth()/2, getHeight()/2, (int)(Math.random()*getWidth()), (int)(Math.random()*getHeight())); } } } /* small bursts in center small bursts randlomly (nested loop) */