KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)ContainerAdapter.java 1.12 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 container 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>ContainerEvent</code> listener
16  * and override the methods for the events of interest. (If you implement the
17  * <code>ContainerListener</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 the extended class and then register it with
22  * a component using the component's <code>addContainerListener</code>
23  * method. When the container's contents change because a component has
24  * been added or removed, the relevant method in the listener object is invoked,
25  * and the <code>ContainerEvent</code> is passed to it.
26  *
27  * @see ContainerEvent
28  * @see ContainerListener
29  * @see <a HREF="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container 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 Amy Fowler
33  * @version 1.12 12/19/03
34  * @since 1.1
35  */

36 public abstract class ContainerAdapter implements ContainerListener JavaDoc {
37     /**
38      * Invoked when a component has been added to the container.
39      */

40     public void componentAdded(ContainerEvent JavaDoc e) {}
41
42     /**
43      * Invoked when a component has been removed from the container.
44      */

45     public void componentRemoved(ContainerEvent JavaDoc e) {}
46 }
47
Popular Tags