FileDocCategorySizeDatePackage
JFrameDemo.javaAPI DocExample821Fri Apr 06 22:35:52 BST 2001None

JFrameDemo

public class JFrameDemo extends JFrame
Just a Frame
version
$Id: JFrameDemo.java,v 1.9 2001/04/07 01:35:52 ian Exp $

Fields Summary
boolean
unsavedChanges
JButton
quitButton
Constructors Summary
public JFrameDemo()
Construct the object including its GUI


	       
	  
		super("JFrameDemo");
		getContentPane().add(quitButton = new JButton("Exit"));

		// These "action handlers" will be explained later in the chapter.
		quitButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				setVisible(false);
				dispose();
				System.exit(0);
			}
		});
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				setVisible(false);
				dispose();
				System.exit(0);
			}
		});
			
		pack();
	
Methods Summary