import java.awt.*; import javax.swing.*; /** * Test button demonstration and listener * CSE 143 Sp03 demo. * * @author Hal Perkins * @version 4/17/03 */ public class ButtonTest { /** * Create a new window with a ButtonListener panel */ public static void main(String[] args) { // Create new window and set it to dispose itself when closed JFrame frame = new JFrame("Button Demo"); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // Add a new ButtonDemo to the window and make it visible frame.getContentPane().add(new ButtonDemo(), BorderLayout.CENTER); frame.pack(); frame.setVisible(true); } }