Package megameklab.ui.util
Class ExitOnWindowClosingListener
java.lang.Object
java.awt.event.WindowAdapter
megameklab.ui.util.ExitOnWindowClosingListener
- All Implemented Interfaces:
WindowFocusListener,WindowListener,WindowStateListener,EventListener
This is a specific WindowAdapter that acts on a windowClosing event by calling the given AppCloser's exit() method
and exits the application if exit() returned true. Add this to any Frame that should exit the application by closing
its window.
-
Constructor Summary
ConstructorsConstructorDescriptionReturns a new window listener for the given frame that will react to windowClosing events by calling the frame's exit() method and closing the application when exit() returns true. -
Method Summary
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
-
Constructor Details
-
ExitOnWindowClosingListener
Returns a new window listener for the given frame that will react to windowClosing events by calling the frame's exit() method and closing the application when exit() returns true.- Parameters:
frame- The frame (implementing AppCloser) that this window listener is for
-
-
Method Details
-
windowClosing
- Specified by:
windowClosingin interfaceWindowListener- Overrides:
windowClosingin classWindowAdapter
-