1. /*
  2. * @(#)WindowFocusListener.java 1.6 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 <code>WindowEvents</code>, including
  11. * <code>WINDOW_GAINED_FOCUS</code> and <code>WINDOW_LOST_FOCUS</code> events.
  12. * The class that is interested in processing a <code>WindowEvent</code>
  13. * either implements this interface (and
  14. * all the methods it contains) or extends the abstract
  15. * <code>WindowAdapter</code> class (overriding only the methods of interest).
  16. * The listener object created from that class is then registered with a
  17. * <code>Window</code>
  18. * using the <code>Window</code>'s <code>addWindowFocusListener</code> method.
  19. * When the <code>Window</code>'s
  20. * status changes by virtue of it being opened, closed, activated, deactivated,
  21. * iconified, or deiconified, or by focus being transfered into or out of the
  22. * <code>Window</code>, the relevant method in the listener object is invoked,
  23. * and the <code>WindowEvent</code> is passed to it.
  24. *
  25. * @author David Mendenhall
  26. * @version 1.6, 12/19/03
  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.4
  34. */
  35. public interface WindowFocusListener extends EventListener {
  36. /**
  37. * Invoked when the Window is set to be the focused Window, which means
  38. * that the Window, or one of its subcomponents, will receive keyboard
  39. * events.
  40. */
  41. public void windowGainedFocus(WindowEvent e);
  42. /**
  43. * Invoked when the Window is no longer the focused Window, which means
  44. * that keyboard events will no longer be delivered to the Window or any of
  45. * its subcomponents.
  46. */
  47. public void windowLostFocus(WindowEvent e);
  48. }