1. /*
  2. * @(#)ContainerAdapter.java 1.9 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 container 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>ContainerEvent</code> listener
  17. * and override the methods for the events of interest. (If you implement the
  18. * <code>ContainerListener</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>addContainerListener</code>
  24. * method. When the container's contents change because a component has
  25. * been added or removed, the relevant method in the listener object is invoked,
  26. * and the <code>ContainerEvent</code> is passed to it.
  27. *
  28. * @see ContainerEvent
  29. * @see ContainerListener
  30. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container 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 Amy Fowler
  34. * @version 1.9 02/02/00
  35. * @since 1.1
  36. */
  37. public abstract class ContainerAdapter implements ContainerListener {
  38. /**
  39. * Invoked when a component has been added to the container.
  40. */
  41. public void componentAdded(ContainerEvent e) {}
  42. /**
  43. * Invoked when a component has been removed from the container.
  44. */
  45. public void componentRemoved(ContainerEvent e) {}
  46. }