home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / event / ComponentAdapter.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.3 KB  |  63 lines

  1. /*
  2.  * @(#)ComponentAdapter.java    1.9 98/03/18
  3.  *
  4.  * Copyright 1996, 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt.event;
  16.  
  17. /**
  18.  * An abstract adapter class for receiving component events.
  19.  * The methods in this class are empty. This class exists as
  20.  * convenience for creating listener objects.
  21.  * <P>
  22.  * Extend this class to create a <code>ComponentEvent</code> listener 
  23.  * and override the methods for the events of interest. (If you implement the 
  24.  * <code>ComponentListener</code> interface, you have to define all of
  25.  * the methods in it. This abstract class defines null methods for them
  26.  * all, so you can only have to define methods for events you care about.)
  27.  * <P>
  28.  * Create a listener object using your class and then register it with a
  29.  * component using the component's <code>addComponentListener</code> 
  30.  * method. When the component's size, location, or visibility
  31.  * changes, the relevant method in the listener object is invoked,
  32.  * and the <code>ComponentEvent</code> is passed to it.
  33.  *
  34.  * @see ComponentEvent
  35.  * @see ComponentListener
  36.  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
  37.  * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  38.  * 
  39.  * @version 1.9 03/18/98
  40.  * @author Carl Quinn
  41.  */
  42. public abstract class ComponentAdapter implements ComponentListener {
  43.     /**
  44.      * Invoked when the component's size changes.
  45.      */
  46.     public void componentResized(ComponentEvent e) {}
  47.     
  48.     /**
  49.      * Invoked when the component's position changes.
  50.      */    
  51.     public void componentMoved(ComponentEvent e) {}
  52.     
  53.     /**
  54.      * Invoked when the component has been made visible.
  55.      */
  56.     public void componentShown(ComponentEvent e) {}
  57.     
  58.     /**
  59.      * Invoked when the component has been made invisible.
  60.      */
  61.     public void componentHidden(ComponentEvent e) {}
  62. }
  63.