com.pearsoneduc.ip.gui
Class WindowMonitor

java.lang.Object
  |
  +--java.awt.event.WindowAdapter
        |
        +--com.pearsoneduc.ip.gui.WindowMonitor

public class WindowMonitor
extends java.awt.event.WindowAdapter

A class providing basic window event handling. Typically it is used as follows:

   public class MyApp extends JFrame {
     public MyApp() {
       ...
       addWindowListener(new WindowMonitor());
       ...
     }
     ...
   }
 
This code is adapted from an example given in Java Swing, by Eckstein, Loy & Wood (O'Reilly & Associates, 1998).

Version:
1.0 [1999/01/20]
Author:
Nick Efford
See Also:
Window, WindowEvent, WindowAdapter

Constructor Summary
WindowMonitor()
           
 
Method Summary
 void windowClosing(java.awt.event.WindowEvent event)
          Specifies behaviour when a window is closed.
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowMonitor

public WindowMonitor()
Method Detail

windowClosing

public void windowClosing(java.awt.event.WindowEvent event)
Specifies behaviour when a window is closed. The window is hidden and disposed of, then the program is terminated.
Parameters:
event - a WindowEvent triggered when a window is closed
Overrides:
windowClosing in class java.awt.event.WindowAdapter