import javax.swing.*; import javax.swing.plaf.*; import java.awt.*; import java.awt.event.*; import java.util.*; /** * This class implements a simple drawing program in java * * @author Stuart Hansen * @version September 28, 2008 */ public class DrawProgram1 extends JFrame { public DrawProgram1 () { super ("Line Draw"); // The DrawPanel is the entire application DrawPanel drawPanel = new DrawPanel(); // setup the drawPanel getContentPane().add(drawPanel); drawPanel.setBackground(Color.white); // Set the current Color drawPanel.setColor(Color.black); // Set the application window's properties setSize (400, 400); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // display the application window setVisible(true); } // a very simple main program public static void main (String args[]) { new DrawProgram1(); } }