1. /*
  2. * @(#)WindowListener.java 1.21 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.event;
  8. import java.util.EventListener;
  9. /**
  10. * The listener interface for receiving window events.
  11. * The class that is interested in processing a window event
  12. * either implements this interface (and all the methods it
  13. * contains) or extends the abstract <code>WindowAdapter</code> class
  14. * (overriding only the methods of interest).
  15. * The listener object created from that class is then registered with a
  16. * Window using the window's <code>addWindowListener</code>
  17. * method. When the window's status changes by virtue of being opened,
  18. * closed, activated or deactivated, iconified or deiconified,
  19. * the relevant method in the listener object is invoked, and the
  20. * <code>WindowEvent</code> is passed to it.
  21. *
  22. * @author Carl Quinn
  23. * @version 1.21, 12/19/03
  24. *
  25. * @see WindowAdapter
  26. * @see WindowEvent
  27. * @see <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/windowlistener.html">Tutorial: How to Write Window Listeners</a>
  28. *
  29. * @since 1.1
  30. */
  31. public interface WindowListener extends EventListener {
  32. /**
  33. * Invoked the first time a window is made visible.
  34. */
  35. public void windowOpened(WindowEvent e);
  36. /**
  37. * Invoked when the user attempts to close the window
  38. * from the window's system menu.
  39. */
  40. public void windowClosing(WindowEvent e);
  41. /**
  42. * Invoked when a window has been closed as the result
  43. * of calling dispose on the window.
  44. */
  45. public void windowClosed(WindowEvent e);
  46. /**
  47. * Invoked when a window is changed from a normal to a
  48. * minimized state. For many platforms, a minimized window
  49. * is displayed as the icon specified in the window's
  50. * iconImage property.
  51. * @see java.awt.Frame#setIconImage
  52. */
  53. public void windowIconified(WindowEvent e);
  54. /**
  55. * Invoked when a window is changed from a minimized
  56. * to a normal state.
  57. */
  58. public void windowDeiconified(WindowEvent e);
  59. /**
  60. * Invoked when the Window is set to be the active Window. Only a Frame or
  61. * a Dialog can be the active Window. The native windowing system may
  62. * denote the active Window or its children with special decorations, such
  63. * as a highlighted title bar. The active Window is always either the
  64. * focused Window, or the first Frame or Dialog that is an owner of the
  65. * focused Window.
  66. */
  67. public void windowActivated(WindowEvent e);
  68. /**
  69. * Invoked when a Window is no longer the active Window. Only a Frame or a
  70. * Dialog can be the active Window. The native windowing system may denote
  71. * the active Window or its children with special decorations, such as a
  72. * highlighted title bar. The active Window is always either the focused
  73. * Window, or the first Frame or Dialog that is an owner of the focused
  74. * Window.
  75. */
  76. public void windowDeactivated(WindowEvent e);
  77. }