FileDocCategorySizeDatePackage
GUIextendsFrame.javaAPI DocExample1026Tue Mar 13 22:36:10 GMT 2001None

GUIextendsFrame

public class GUIextendsFrame extends Frame
Template standalone GUI application.
author
Ian F. Darwin, ian@darwinsys.com
version
#Id$

Fields Summary
boolean
unsavedChanges
Button
quitButton
Constructors Summary
public GUIextendsFrame()
Construct the object including its GUI

		super("GUIextendsFrame");
		setLayout(new FlowLayout());
		add(new Label("Hello, and welcome to the world of Java"));
		add(quitButton = new Button("Exit"));
		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
public static voidmain(java.lang.String[] av)
"main program" method - construct and show


	        
	     
		// create a GUIextendsFrame object, tell it to show up
		new GUIextendsFrame().setVisible(true);