java.awt.event
Class ContainerAdapter

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.event.ContainerAdapter
All Implemented Interfaces:
ContainerListener sample code for java.awt.event.ContainerListener definition code for java.awt.event.ContainerListener , EventListener sample code for java.util.EventListener definition code for java.util.EventListener

public abstract class ContainerAdapter
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements ContainerListener sample code for java.awt.event.ContainerListener definition code for java.awt.event.ContainerListener

An abstract adapter class for receiving container events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Extend this class to create a ContainerEvent listener and override the methods for the events of interest. (If you implement the ContainerListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)

Create a listener object using the extended class and then register it with a component using the component's addContainerListener method. When the container's contents change because a component has been added or removed, the relevant method in the listener object is invoked, and the ContainerEvent is passed to it.

Since:
1.1
See Also:
ContainerEvent sample code for java.awt.event.ContainerEvent definition code for java.awt.event.ContainerEvent , ContainerListener sample code for java.awt.event.ContainerListener definition code for java.awt.event.ContainerListener , Tutorial: Writing a Container Listener, Reference: The Java Class Libraries (update file)

Constructor Summary
ContainerAdapter sample code for java.awt.event.ContainerAdapter.ContainerAdapter() definition code for java.awt.event.ContainerAdapter.ContainerAdapter() ()
           
 
Method Summary
 void componentAdded sample code for java.awt.event.ContainerAdapter.componentAdded(java.awt.event.ContainerEvent) definition code for java.awt.event.ContainerAdapter.componentAdded(java.awt.event.ContainerEvent) (ContainerEvent sample code for java.awt.event.ContainerEvent definition code for java.awt.event.ContainerEvent  e)
          Invoked when a component has been added to the container.
 void componentRemoved sample code for java.awt.event.ContainerAdapter.componentRemoved(java.awt.event.ContainerEvent) definition code for java.awt.event.ContainerAdapter.componentRemoved(java.awt.event.ContainerEvent) (ContainerEvent sample code for java.awt.event.ContainerEvent definition code for java.awt.event.ContainerEvent  e)
          Invoked when a component has been removed from the container.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

ContainerAdapter sample code for java.awt.event.ContainerAdapter() definition code for java.awt.event.ContainerAdapter()

public ContainerAdapter()
Method Detail

componentAdded sample code for java.awt.event.ContainerAdapter.componentAdded(java.awt.event.ContainerEvent) definition code for java.awt.event.ContainerAdapter.componentAdded(java.awt.event.ContainerEvent)

public void componentAdded(ContainerEvent sample code for java.awt.event.ContainerEvent definition code for java.awt.event.ContainerEvent  e)
Invoked when a component has been added to the container.

Specified by:
componentAdded sample code for java.awt.event.ContainerListener.componentAdded(java.awt.event.ContainerEvent) definition code for java.awt.event.ContainerListener.componentAdded(java.awt.event.ContainerEvent) in interface ContainerListener sample code for java.awt.event.ContainerListener definition code for java.awt.event.ContainerListener

componentRemoved sample code for java.awt.event.ContainerAdapter.componentRemoved(java.awt.event.ContainerEvent) definition code for java.awt.event.ContainerAdapter.componentRemoved(java.awt.event.ContainerEvent)

public void componentRemoved(ContainerEvent sample code for java.awt.event.ContainerEvent definition code for java.awt.event.ContainerEvent  e)
Invoked when a component has been removed from the container.

Specified by:
componentRemoved sample code for java.awt.event.ContainerListener.componentRemoved(java.awt.event.ContainerEvent) definition code for java.awt.event.ContainerListener.componentRemoved(java.awt.event.ContainerEvent) in interface ContainerListener sample code for java.awt.event.ContainerListener definition code for java.awt.event.ContainerListener