import javax.swing.*; import java.awt.*; import java.awt.event.*; /** * Modified for graphics drawing by RPF 7/6/02 (in Philly) * (courtesy of the hotel's nice internet port in my room). * First thing to do is to move the creation of the components, * along with the paintComponent method, to another class. * Next, a version that responds to mouse hits and one to * mouse drags. Then menus, etc. */ public class SwingApplication { public static void main(String[] args) { //Create the top-level container and add contents to it. JFrame frame = new JFrame("SwingApplication"); Component contents = new Components(); frame.getContentPane().add(contents, BorderLayout.CENTER); //Finish setting up the frame, and show it. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setSize(400,200); frame.setVisible(true); } } // class SwingApplication