1. /*
  2. * @(#)FocusListener.java 1.12 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 keyboard focus events on
  14. * a component.
  15. * The class that is interested in processing a focus event
  16. * either implements this interface (and all the methods it
  17. * contains) or extends the abstract <code>FocusAdapter</code> class
  18. * (overriding only the methods of interest).
  19. * The listener object created from that class is then registered with a
  20. * component using the component's <code>addFocusListener</code>
  21. * method. When the component gains or loses the keyboard focus,
  22. * the relevant method in the listener object
  23. * is invoked, and the <code>FocusEvent</code> is passed to it.
  24. *
  25. * @see FocusAdapter
  26. * @see FocusEvent
  27. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
  28. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  29. *
  30. * @author Carl Quinn
  31. * @version 1.12 02/02/00
  32. * @since 1.1
  33. */
  34. public interface FocusListener extends EventListener {
  35. /**
  36. * Invoked when a component gains the keyboard focus.
  37. */
  38. public void focusGained(FocusEvent e);
  39. /**
  40. * Invoked when a component loses the keyboard focus.
  41. */
  42. public void focusLost(FocusEvent e);
  43. }