1. /*
  2. * @(#)ComponentAdapter.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 component 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>ComponentEvent</code> listener
  17. * and override the methods for the events of interest. (If you implement the
  18. * <code>ComponentListener</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 your class and then register it with a
  23. * component using the component's <code>addComponentListener</code>
  24. * method. When the component's size, location, or visibility
  25. * changes, the relevant method in the listener object is invoked,
  26. * and the <code>ComponentEvent</code> is passed to it.
  27. *
  28. * @see ComponentEvent
  29. * @see ComponentListener
  30. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component 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 ComponentAdapter implements ComponentListener {
  38. /**
  39. * Invoked when the component's size changes.
  40. */
  41. public void componentResized(ComponentEvent e) {}
  42. /**
  43. * Invoked when the component's position changes.
  44. */
  45. public void componentMoved(ComponentEvent e) {}
  46. /**
  47. * Invoked when the component has been made visible.
  48. */
  49. public void componentShown(ComponentEvent e) {}
  50. /**
  51. * Invoked when the component has been made invisible.
  52. */
  53. public void componentHidden(ComponentEvent e) {}
  54. }