KickJava   Java API By Example, From Geeks To Geeks.

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


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
8 package java.awt.event;
9
10 import java.util.EventListener JavaDoc;
11
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.16 12/19/03
36  * @since 1.1
37  */

38 public interface ComponentListener extends EventListener JavaDoc {
39     /**
40      * Invoked when the component's size changes.
41      */

42     public void componentResized(ComponentEvent JavaDoc e);
43
44     /**
45      * Invoked when the component's position changes.
46      */

47     public void componentMoved(ComponentEvent JavaDoc e);
48
49     /**
50      * Invoked when the component has been made visible.
51      */

52     public void componentShown(ComponentEvent JavaDoc e);
53
54     /**
55      * Invoked when the component has been made invisible.
56      */

57     public void componentHidden(ComponentEvent JavaDoc e);
58 }
59
Popular Tags