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 abstract void windowOpened(WindowEvent e)
  public abstract void windowClosing(WindowEvent e)
  public abstract void windowClosed(WindowEvent e)
  public abstract void windowIconified(WindowEvent e)
  public abstract void windowDeiconified(WindowEvent e)
  public abstract void windowActivated(WindowEvent e)
  public abstract void windowDeactivated(WindowEvent e)

Previous | Next | Top
Last Modified June 30, 1998
Copyright 1997, 1998 Elliotte Rusty Harold
elharo@metalab.unc.edu