KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > event > ComponentAdapter


1 /*
2  * @(#)ComponentAdapter.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
8 package java.awt.event;
9
10 /**
11  * An abstract adapter class for receiving component events.
12  * The methods in this class are empty. This class exists as
13  * convenience for creating listener objects.
14  * <P>
15  * Extend this class to create a <code>ComponentEvent</code> listener
16  * and override the methods for the events of interest. (If you implement the
17  * <code>ComponentListener</code> interface, you have to define all of
18  * the methods in it. This abstract class defines null methods for them
19  * all, so you can only have to define methods for events you care about.)
20  * <P>
21  * Create a listener object using your class and then register it with a
22  * component using the component's <code>addComponentListener</code>
23  * method. When the component's size, location, or visibility
24  * changes, the relevant method in the listener object is invoked,
25  * and the <code>ComponentEvent</code> is passed to it.
26  *
27  * @see ComponentEvent
28  * @see ComponentListener
29  * @see <a HREF="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
30  * @see <a HREF="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
31  *
32  * @author Carl Quinn
33  * @version 1.16 12/19/03
34  * @since 1.1
35  */

36 public abstract class ComponentAdapter implements ComponentListener JavaDoc {
37     /**
38      * Invoked when the component's size changes.
39      */

40     public void componentResized(ComponentEvent JavaDoc e) {}
41     
42     /**
43      * Invoked when the component's position changes.
44      */

45     public void componentMoved(ComponentEvent JavaDoc e) {}
46     
47     /**
48      * Invoked when the component has been made visible.
49      */

50     public void componentShown(ComponentEvent JavaDoc e) {}
51     
52     /**
53      * Invoked when the component has been made invisible.
54      */

55     public void componentHidden(ComponentEvent JavaDoc e) {}
56 }
57
Popular Tags