1. /*
  2. * @(#)ContainerAdapter.java 1.7 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 container 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>ContainerEvent</code> listener
  14. * and override the methods for the events of interest. (If you implement the
  15. * <code>ContainerListener</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 the extended class and then register it with
  20. * a component using the component's <code>addContainerListener</code>
  21. * method. When the container's contents change because a component has
  22. * been added or removed, the relevant method in the listener object is invoked,
  23. * and the <code>ContainerEvent</code> is passed to it.
  24. *
  25. * @see ContainerEvent
  26. * @see ContainerListener
  27. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container 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.7 11/29/01
  31. * @author Amy Fowler
  32. */
  33. public abstract class ContainerAdapter implements ContainerListener {
  34. /**
  35. * Invoked when a component has been added to the container.
  36. */
  37. public void componentAdded(ContainerEvent e) {}
  38. /**
  39. * Invoked when a component has been removed from the container.
  40. */
  41. public void componentRemoved(ContainerEvent e) {}
  42. }