Class WindowHandler

All Implemented Interfaces:
java.util.EventListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.awt.event.WindowStateListener

public class WindowHandler
extends java.awt.event.WindowAdapter

Kills a Swing program. This is a small class that can be used to kill a Swing program. It just disposes the main frame of the application so if you need something more complex, roll your own. The main frame of the app should be passed into this class in the constructor. Created 28-MAR-2001 Modified 11-MAY-2001

Rajnish Bhaskar

Constructor Summary
WindowHandler(javax.swing.JFrame a)
Method Summary
 void windowClosing()
          This can be called from the application.
 void windowClosing(java.awt.event.WindowEvent we)
          this method gets called whenever an event that closes a window is thrown.
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public WindowHandler(javax.swing.JFrame a)
a - The JFrame of the window that this class will be attached to
Method Detail


public void windowClosing(java.awt.event.WindowEvent we)
this method gets called whenever an event that closes a window is thrown. It just disposes of resources in the JFrame that calls it and quits

Specified by:
windowClosing in interface java.awt.event.WindowListener
windowClosing in class java.awt.event.WindowAdapter


public void windowClosing()
This can be called from the application. It will just dispose of that window and then quit the program. It saves having to write a class for handling something like an exit button.