Window Events

Since java.awt.Window is a subclass of java.awt.Component, a Window, Frame or Dialog can fire events. In particular it fires WindowEvents. There are seven of these:

To respond to these events you register a WindowListener object with the window. The object must implement the WindowListener interface and include these methods:

  public void windowOpened(WindowEvent evt)
  public void windowClosing(WindowEvent evt)
  public void windowClosed(WindowEvent evt)
  public void windowIconified(WindowEvent evt)
  public void windowDeiconified(WindowEvent evt)
  public void windowActivated(WindowEvent evt)
  public void windowDeactivated(WindowEvent evt)

Previous | Next | Top | Cafe au Lait

Copyright 1997, 1998, 2002, 2005 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified July 1, 2005