1. /*
  2. * @(#)ContainerListener.java 1.8 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. import java.util.EventListener;
  12. /**
  13. * The listener interface for receiving container events.
  14. * The class that is interested in processing a container event
  15. * either implements this interface (and all the methods it
  16. * contains) or extends the abstract <code>ContainerAdapter</code> class
  17. * (overriding only the methods of interest).
  18. * The listener object created from that class is then registered with a
  19. * component using the component's <code>addContainerListener</code>
  20. * method. When the container's contents change because a component
  21. * has been added or removed, the relevant method in the listener object
  22. * is invoked, and the <code>ContainerEvent</code> is passed to it.
  23. * <P>
  24. * Container events are provided for notification purposes ONLY;
  25. * The AWT will automatically handle add and remove operations
  26. * internally so the program works properly regardless of
  27. * whether the program registers a <code>ComponentListener</code> or not.
  28. *
  29. * @see ContainerAdapter
  30. * @see ContainerEvent
  31. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
  32. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  33. *
  34. * @author Tim Prinzing
  35. * @author Amy Fowler
  36. * @version 1.8 02/02/00
  37. * @since 1.1
  38. */
  39. public interface ContainerListener extends EventListener {
  40. /**
  41. * Invoked when a component has been added to the container.
  42. */
  43. public void componentAdded(ContainerEvent e);
  44. /**
  45. * Invoked when a component has been removed from the container.
  46. */
  47. public void componentRemoved(ContainerEvent e);
  48. }