1. /*
  2. * @(#)FocusAdapter.java 1.13 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. /**
  12. * An abstract adapter class for receiving keyboard focus events.
  13. * The methods in this class are empty. This class exists as
  14. * convenience for creating listener objects.
  15. * <P>
  16. * Extend this class to create a <code>FocusEvent</code> listener
  17. * and override the methods for the events of interest. (If you implement the
  18. * <code>FocusListener</code> interface, you have to define all of
  19. * the methods in it. This abstract class defines null methods for them
  20. * all, so you can only have to define methods for events you care about.)
  21. * <P>
  22. * Create a listener object using the extended class and then register it with
  23. * a component using the component's <code>addFocusListener</code>
  24. * method. When the component gains or loses the keyboard focus,
  25. * the relevant method in the listener object is invoked,
  26. * and the <code>FocusEvent</code> is passed to it.
  27. *
  28. * @see FocusEvent
  29. * @see FocusListener
  30. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus 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. * @author Carl Quinn
  34. * @version 1.13 02/02/00
  35. * @since 1.1
  36. */
  37. public abstract class FocusAdapter implements FocusListener {
  38. /**
  39. * Invoked when a component gains the keyboard focus.
  40. */
  41. public void focusGained(FocusEvent e) {}
  42. /**
  43. * Invoked when a component loses the keyboard focus.
  44. */
  45. public void focusLost(FocusEvent e) {}
  46. }