1. /*
  2. * @(#)ComponentListener.java 1.16 03/12/19
  3. *
  4. * Copyright 2004 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. * @author Carl Quinn
  32. * @version 1.16 12/19/03
  33. * @since 1.1
  34. */
  35. public interface ComponentListener extends EventListener {
  36. /**
  37. * Invoked when the component's size changes.
  38. */
  39. public void componentResized(ComponentEvent e);
  40. /**
  41. * Invoked when the component's position changes.
  42. */
  43. public void componentMoved(ComponentEvent e);
  44. /**
  45. * Invoked when the component has been made visible.
  46. */
  47. public void componentShown(ComponentEvent e);
  48. /**
  49. * Invoked when the component has been made invisible.
  50. */
  51. public void componentHidden(ComponentEvent e);
  52. }