Class Quitter

java.lang.Object
  |
  +--java.awt.event.WindowAdapter
        |
        +--Quitter

public class Quitter
extends java.awt.event.WindowAdapter
implements java.awt.event.ActionListener

a quitting class, used when windows are closed or quit menu item chosen (or any other quit action event)

pattern: uses singleton for one instance per program

inheritance: subclasses can override doQuit() for application-specific cleanup


Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  void doQuit()
          the function called for any quit event, e.g., window closing or quit menu item for chosen
static Quitter getInstance()
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Quitter getInstance()

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Overrides:
windowClosing in class java.awt.event.WindowAdapter

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

doQuit

protected void doQuit()
the function called for any quit event, e.g., window closing or quit menu item for chosen