1. /*
  2. * @(#)ComponentAdapter.java 1.11 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.event;
  8. /**
  9. * An abstract adapter class for receiving component events.
  10. * The methods in this class are empty. This class exists as
  11. * convenience for creating listener objects.
  12. * <P>
  13. * Extend this class to create a <code>ComponentEvent</code> listener
  14. * and override the methods for the events of interest. (If you implement the
  15. * <code>ComponentListener</code> interface, you have to define all of
  16. * the methods in it. This abstract class defines null methods for them
  17. * all, so you can only have to define methods for events you care about.)
  18. * <P>
  19. * Create a listener object using your class and then register it with a
  20. * component using the component's <code>addComponentListener</code>
  21. * method. When the component's size, location, or visibility
  22. * changes, the relevant method in the listener object is invoked,
  23. * and the <code>ComponentEvent</code> is passed to it.
  24. *
  25. * @see ComponentEvent
  26. * @see ComponentListener
  27. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component 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. * @version 1.11 11/29/01
  31. * @author Carl Quinn
  32. */
  33. public abstract class ComponentAdapter implements ComponentListener {
  34. /**
  35. * Invoked when the component's size changes.
  36. */
  37. public void componentResized(ComponentEvent e) {}
  38. /**
  39. * Invoked when the component's position changes.
  40. */
  41. public void componentMoved(ComponentEvent e) {}
  42. /**
  43. * Invoked when the component has been made visible.
  44. */
  45. public void componentShown(ComponentEvent e) {}
  46. /**
  47. * Invoked when the component has been made invisible.
  48. */
  49. public void componentHidden(ComponentEvent e) {}
  50. }