import java.util.Random;
import javax.swing.JFrame;
import java.awt.*;
public class RandomColorGenerator extends JFrame
{
public int red=0, green=0, blue=0; 
public Random myGen = new Random();
public Color newColor;
public int size = 600;
public RandomColorGenerator()
   {
   setDefaultCloseOperation( EXIT_ON_CLOSE );
	setSize( size, size );
	setLocation( 60, 60 );
	setVisible( true );
   } // end constructor
	
public void paint( Graphics g )
   {
	for( int i=0; i<100000; i=i+1)
	   {	
	   red = myGen.nextInt( 256 );
	   green = myGen.nextInt( 256 );
	   blue = myGen.nextInt( 256 );
	   newColor = new Color( red, green, blue );
	   g.setColor( newColor );
	   g.fillRect( 0, 0, size, size );
		}
	}
public static void main(String args [])
   {
   RandomColorGenerator app = new RandomColorGenerator();
   } // end main
} // end class
