FileDocCategorySizeDatePackage
MyFrame.javaAPI DocExample1818Sun Dec 27 14:20:54 GMT 1998None

MyFrame

public class MyFrame extends Frame implements WindowListener, ActionListener

Fields Summary
private Button
btnClose
private Button
btnOk
Constructors Summary
public MyFrame()

	   setTitle ("This is my Frame");
	   setBackground (Color.lightGray);

	     //Create a toolbar Panel object and add the buttons
	   Panel panToolbar = new Panel ();
		 panToolbar.setLayout (new FlowLayout (FlowLayout.LEFT));
	       btnClose = new Button ("Close");
		   btnOk = new Button ("OK");
	     panToolbar.add ( btnClose );
		 panToolbar.add ( btnOk );
	   add ( panToolbar, "North");

	   add (new EtchedLabel (), "Center" );

	   addWindowListener (this);
	   btnClose.addActionListener (this);
	   btnOk.addActionListener (this);
	
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent e)

	   if ( e.getSource() == btnClose )
	     {
	     System.out.println ("Action ");
	     System.exit(0);
	     }

	   if ( e.getSource() == btnOk )
	     {
	     System.out.println ("Action on BtnOk");
	     }
    
public voidwindowActivated(java.awt.event.WindowEvent e)

	   System.out.println ("Window Activated");
    
public voidwindowClosed(java.awt.event.WindowEvent e)

	   System.out.println ("Window Closed");
	   System.exit(0);
    
public voidwindowClosing(java.awt.event.WindowEvent e)

	   System.out.println ("Window Closing");
	   dispose();
    
public voidwindowDeactivated(java.awt.event.WindowEvent e)

	   System.out.println ("Window Deactivated");
    
public voidwindowDeiconified(java.awt.event.WindowEvent e)

	   System.out.println ("Window Deiconified");
    
public voidwindowIconified(java.awt.event.WindowEvent e)

	   System.out.println ("Window Iconified");
    
public voidwindowOpened(java.awt.event.WindowEvent e)

	   System.out.println ("Window Opened");