1. /*
  2. * @(#)ComponentListener.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. import java.util.EventListener;
  9. /**
  10. * The listener interface for receiving component events.
  11. * The class that is interested in processing a component event
  12. * either implements this interface (and all the methods it
  13. * contains) or extends the abstract <code>ComponentAdapter</code> class
  14. * (overriding only the methods of interest).
  15. * The listener object created from that class is then registered with a
  16. * component using the component's <code>addComponentListener</code>
  17. * method. When the component's size, location, or visibility
  18. * changes, the relevant method in the listener object is invoked,
  19. * and the <code>ComponentEvent</code> is passed to it.
  20. * <P>
  21. * Component events are provided for notification purposes ONLY;
  22. * The AWT will automatically handle component moves and resizes
  23. * internally so that GUI layout works properly regardless of
  24. * whether a program registers a <code>ComponentListener</code> or not.
  25. *
  26. * @see ComponentAdapter
  27. * @see ComponentEvent
  28. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
  29. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  30. *
  31. * @version 1.11 11/29/01
  32. * @author Carl Quinn
  33. */
  34. public interface ComponentListener extends EventListener {
  35. /**
  36. * Invoked when the component's size changes.
  37. */
  38. public void componentResized(ComponentEvent e);
  39. /**
  40. * Invoked when the component's position changes.
  41. */
  42. public void componentMoved(ComponentEvent e);
  43. /**
  44. * Invoked when the component has been made visible.
  45. */
  46. public void componentShown(ComponentEvent e);
  47. /**
  48. * Invoked when the component has been made invisible.
  49. */
  50. public void componentHidden(ComponentEvent e);
  51. }