1. /*
  2. * @(#)WindowListener.java 1.12 01/11/29
  3. *
  4. * Copyright 2002 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 winodw'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
  20. * object s invoked, and the <code>WindowEvent</code> is passed to it.
  21. *
  22. * @see WindowAdapter
  23. * @see WindowEvent
  24. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
  25. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  26. *
  27. * @version 1.12 11/29/01
  28. * @author Carl Quinn
  29. */
  30. public interface WindowListener extends EventListener {
  31. /**
  32. * Invoked the first time a window is made visible.
  33. */
  34. public void windowOpened(WindowEvent e);
  35. /**
  36. * Invoked when the user attempts to close the window
  37. * from the window's system menu. If the program does not
  38. * explicitly hide or dispose the window while processing
  39. * this event, the window close operation will be cancelled.
  40. */
  41. public void windowClosing(WindowEvent e);
  42. /**
  43. * Invoked when a window has been closed as the result
  44. * of calling dispose on the window.
  45. */
  46. public void windowClosed(WindowEvent e);
  47. /**
  48. * Invoked when a window is changed from a normal to a
  49. * minimized state. For many platforms, a minimized window
  50. * is displayed as the icon specified in the window's
  51. * iconImage property.
  52. * @see Frame#setIconImage
  53. */
  54. public void windowIconified(WindowEvent e);
  55. /**
  56. * Invoked when a window is changed from a minimized
  57. * to a normal state.
  58. */
  59. public void windowDeiconified(WindowEvent e);
  60. /**
  61. * Invoked when the window is set to be the user's
  62. * active window, which means the window (or one of its
  63. * subcomponents) will receive keyboard events.
  64. */
  65. public void windowActivated(WindowEvent e);
  66. /**
  67. * Invoked when a window is no longer the user's active
  68. * window, which means that keyboard events will no longer
  69. * be delivered to the window or its subcomponents.
  70. */
  71. public void windowDeactivated(WindowEvent e);
  72. }