kirk.gui.closer
Class WindowCloser
java.lang.Object
java.awt.event.WindowAdapter
kirk.gui.closer.WindowCloser
- All Implemented Interfaces:
- EventListener, WindowFocusListener, WindowListener, WindowStateListener
- Direct Known Subclasses:
- FinishingCloser, GLWindowCloser
- public class WindowCloser
- extends WindowAdapter
This class closes Window
s that generate WindowEvents
asking for it. If specified, it can also end the program after the closing of a
Window
. This is useful for main Window
s.
- Version:
- 1
- Author:
- Berend Wouda
- See Also:
Window
Field Summary |
private boolean |
exit
Whether or not to exit after the window is closed. |
Constructor Summary |
WindowCloser()
Constructs a WindowCloser that does not end the program after
closing. |
WindowCloser(boolean exit)
Constructs a WindowCloser with the indicated setting for whether
to exit the program after closing the window. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
exit
private boolean exit
- Whether or not to exit after the window is closed.
WindowCloser
public WindowCloser(boolean exit)
- Constructs a
WindowCloser
with the indicated setting for whether
to exit the program after closing the window.
- Parameters:
exit
- true
if the program should exit after closing a
window, false
otherwise.
WindowCloser
public WindowCloser()
- Constructs a
WindowCloser
that does not end the program after
closing.
windowClosing
public void windowClosing(WindowEvent event)
- Closes the
Window
indicated by the given
WindowEvent
.
- Parameters:
event
- The event that indicates which Window
to close.