|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.WindowAdapter
com.croftsoft.core.gui.ShutdownWindowAdapter
public class ShutdownWindowAdapter
Performs a graceful shutdown of a program when the window is closed.
Example:
jFrame.setDefaultCloseOperation (
javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE );
jFrame.addWindowListener (
new ShutdownWindowAdapter ( this, "Exit Program?" ) );
Constructor Summary | |
---|---|
ShutdownWindowAdapter()
|
|
ShutdownWindowAdapter(Destroyable destroyable)
Convenience constructor. |
|
ShutdownWindowAdapter(Destroyable[] destroyables)
Convenience constructor. |
|
ShutdownWindowAdapter(Destroyable[] destroyables,
String shutdownConfirmationPrompt)
Convenience constructor. |
|
ShutdownWindowAdapter(Destroyable[] destroyables,
String shutdownConfirmationPrompt,
String shutdownConfirmationTitle)
Main constructor. |
|
ShutdownWindowAdapter(Destroyable destroyable,
String shutdownConfirmationPrompt)
Convenience constructor. |
Method Summary | |
---|---|
void |
windowClosing(WindowEvent windowEvent)
|
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 ShutdownWindowAdapter(Destroyable[] destroyables, String shutdownConfirmationPrompt, String shutdownConfirmationTitle)
destroyables
- May be null.shutdownConfirmationPrompt
- If null, no shutdown confirmation prompt dialog will be given.shutdownConfirmationTitle
- If null, the shutdownConfirmationPrompt value will be used.public ShutdownWindowAdapter(Destroyable[] destroyables, String shutdownConfirmationPrompt)
this ( destroyables, shutdownConfirmationPrompt, null );
public ShutdownWindowAdapter(Destroyable destroyable, String shutdownConfirmationPrompt)
this (
new Destroyable [ ] { destroyable },
shutdownConfirmationPrompt );
public ShutdownWindowAdapter(Destroyable[] destroyables)
this ( destroyables, null );
public ShutdownWindowAdapter(Destroyable destroyable)
this ( new Destroyable [ ] { destroyable } );
public ShutdownWindowAdapter()
Method Detail |
---|
public void windowClosing(WindowEvent windowEvent)
windowClosing
in interface WindowListener
windowClosing
in class WindowAdapter
|
CroftSoft Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |