WindowCloserpublic class WindowCloser extends WindowAdapter A WindowCloser - watch for Window Closing events, and
follow them up with setVisible(false), dispose(), and optionally
ends (it all) with a System.exit(0).
|
Fields Summary |
---|
Window | winThe window we are to close | boolean | doExitTrue if we are to exit as well. |
Constructors Summary |
---|
public WindowCloser(Window w)Construct a WindowCloser that doesn't exit, just closes the window
this(w, false);
| public WindowCloser(Window w, boolean exit)Construct a WindowCloser with control over whether it exits
win = w;
doExit = exit;
|
Methods Summary |
---|
public void | windowClosing(java.awt.event.WindowEvent e)Called by AWT when the user tries to close the window
win.setVisible(false);
win.dispose();
if (doExit)
System.exit(0);
|
|