1. /*
  2. * @(#)ComponentListener.java 1.13 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 component events.
  14. * The class that is interested in processing a component event
  15. * either implements this interface (and all the methods it
  16. * contains) or extends the abstract <code>ComponentAdapter</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>addComponentListener</code>
  20. * method. When the component's size, location, or visibility
  21. * changes, the relevant method in the listener object is invoked,
  22. * and the <code>ComponentEvent</code> is passed to it.
  23. * <P>
  24. * Component events are provided for notification purposes ONLY;
  25. * The AWT will automatically handle component moves and resizes
  26. * internally so that GUI layout works properly regardless of
  27. * whether a program registers a <code>ComponentListener</code> or not.
  28. *
  29. * @see ComponentAdapter
  30. * @see ComponentEvent
  31. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component 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 Carl Quinn
  35. * @version 1.13 02/02/00
  36. * @since 1.1
  37. */
  38. public interface ComponentListener extends EventListener {
  39. /**
  40. * Invoked when the component's size changes.
  41. */
  42. public void componentResized(ComponentEvent e);
  43. /**
  44. * Invoked when the component's position changes.
  45. */
  46. public void componentMoved(ComponentEvent e);
  47. /**
  48. * Invoked when the component has been made visible.
  49. */
  50. public void componentShown(ComponentEvent e);
  51. /**
  52. * Invoked when the component has been made invisible.
  53. */
  54. public void componentHidden(ComponentEvent e);
  55. }