Fenster schließen

Das ,,Schließen``-Ereignis behandeln:
static class Closer extends WindowAdapter {
  public void windowClosing (WindowEvent e) {
    e.getWindow().dispose();
    System.exit (0);
  }
}
public static void main (String [] argv) {
  Frame f = new Frame ("Foobar");
  f.addWindowListener (new Closer ());
  ...
}



Johannes Waldmann 2007-01-23