Final CS360 - Painter
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Painter
{
public static void main( String[] args )
{
// create JFrame
JFrame application = new JFrame( "A simple paint program" );
PaintPanel paintPanel = new PaintPanel(); // create paint panel
application.add( paintPanel, BorderLayout.CENTER ); // in center
// create a label and place it on SOUTH of BorderLayout
application.add( new JLabel("Grag the mouse to dra"),
BorderLayout.SOUTH );
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
application.setSize( 400, 200 ); // set frame size
application.setVisible( true ); // display frame
} // end main
} // end class Painter
No comments:
Post a Comment