- 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.
- Rajnish Bhaskar
This can be called from the application.
this method gets called whenever an event that closes a window is
|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
public WindowHandler(javax.swing.JFrame a)
a - The JFrame of the window that this class will be attached
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
- Specified by:
windowClosing in interface
windowClosing in class
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.