import javax.swing.*;
import java.awt.*;
import java.util.Random;
public class ColorTest extends JFrame
{
public int size = 400;
public Color boxColor;
public ColorTest()
   {
	boxColor = JColorChooser.showDialog( null, "Choose a color", Color.pink);
   setDefaultCloseOperation( EXIT_ON_CLOSE );
   setSize( size, size );
   setLocation( 200, 100 );
   setVisible( true );
   } // end constructor

// "paint" is a method already in JFrame
// it's called automajically by the computer
// it uses the Graphics helper class
// I'm rewriting it
// That's called over-riding 
public void paint( Graphics g )
   {
   g.setColor( boxColor );
   g.fillRect(0, 0, size, size);
   }
	
public static void main(String args [])
   {
	ColorTest app = new ColorTest();
	}
}

