public class AppCloser
extends java.awt.event.WindowAdapter
implements java.awt.event.ActionListener
| Modifier and Type | Field and Description |
|---|---|
private boolean |
exitOnClose |
private javax.swing.Icon |
icon |
private boolean |
notifyOnClose |
private java.awt.Window |
window |
| Constructor and Description |
|---|
AppCloser() |
AppCloser(boolean noc,
boolean eoc) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
close()
Close window -- in this case, the application also closes.
|
void |
exit()
Exit the application, wherever it is.
|
javax.swing.Icon |
getIcon() |
boolean |
isExitOnClose() |
boolean |
isNotifyOnClose() |
void |
setExitOnClose(boolean eoc) |
void |
setIcon(javax.swing.Icon icon) |
void |
setNotifyOnClose(boolean noc) |
void |
windowClosing(java.awt.event.WindowEvent e)
Invoke close() method when window closes.
|
private boolean notifyOnClose
private boolean exitOnClose
private java.awt.Window window
private javax.swing.Icon icon
public AppCloser(boolean noc,
boolean eoc)
public AppCloser()
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenerwindowClosing in class java.awt.event.WindowAdaptere - Given WindowEventpublic void close()
public void setNotifyOnClose(boolean noc)
public boolean isNotifyOnClose()
public void setExitOnClose(boolean eoc)
public boolean isExitOnClose()
public void exit()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
icon - the icon to set