1. /*
  2. * @(#)WindowListener.java 1.16 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt.event;
  11. import java.util.EventListener;
  12. /**
  13. * The listener interface for receiving window events.
  14. * The class that is interested in processing a window event
  15. * either implements this interface (and all the methods it
  16. * contains) or extends the abstract <code>WindowAdapter</code> class
  17. * (overriding only the methods of interest).
  18. * The listener object created from that class is then registered with a
  19. * Window using the window's <code>addWindowListener</code>
  20. * method. When the window's status changes by virtue of being opened,
  21. * closed, activated or deactivated, iconified or deiconified,
  22. * the relevant method in the listener object is invoked, and the
  23. * <code>WindowEvent</code> is passed to it.
  24. *
  25. * @author Carl Quinn
  26. * @version 1.16, 02/02/00
  27. *
  28. * @see WindowAdapter
  29. * @see WindowEvent
  30. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
  31. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  32. *
  33. * @since 1.1
  34. */
  35. public interface WindowListener extends EventListener {
  36. /**
  37. * Invoked the first time a window is made visible.
  38. */
  39. public void windowOpened(WindowEvent e);
  40. /**
  41. * Invoked when the user attempts to close the window
  42. * from the window's system menu. If the program does not
  43. * explicitly hide or dispose the window while processing
  44. * this event, the window close operation will be cancelled.
  45. */
  46. public void windowClosing(WindowEvent e);
  47. /**
  48. * Invoked when a window has been closed as the result
  49. * of calling dispose on the window.
  50. */
  51. public void windowClosed(WindowEvent e);
  52. /**
  53. * Invoked when a window is changed from a normal to a
  54. * minimized state. For many platforms, a minimized window
  55. * is displayed as the icon specified in the window's
  56. * iconImage property.
  57. * @see java.awt.Frame#setIconImage
  58. */
  59. public void windowIconified(WindowEvent e);
  60. /**
  61. * Invoked when a window is changed from a minimized
  62. * to a normal state.
  63. */
  64. public void windowDeiconified(WindowEvent e);
  65. /**
  66. * Invoked when the window is set to be the user's
  67. * active window, which means the window (or one of its
  68. * subcomponents) will receive keyboard events.
  69. */
  70. public void windowActivated(WindowEvent e);
  71. /**
  72. * Invoked when a window is no longer the user's active
  73. * window, which means that keyboard events will no longer
  74. * be delivered to the window or its subcomponents.
  75. */
  76. public void windowDeactivated(WindowEvent e);
  77. }