java.awt.event.ContainerEvent (JDK 1.1)
An event of this type serves as notification that the source Container has had a child added to it or removed from it. Note that this event is a notification only; the AWT adds or removes the child internally, and the recipient of this event need take no action itself.
getChild() returns the child Component that was added or removed, and getContainer() returns the Container that it was added to or removed from. getContainer() is simply a convenient alternative to getSource().
getID() returns the constant COMPONENT_ADDED or COMPONENT_REMOVED to indicate whether the specified child was added or removed.
public classContainerEventextends ComponentEvent { //Public ConstructorpublicContainerEvent(Componentsource, intid, Componentchild); //Constantspublic static final intCOMPONENT_ADDED; public static final intCOMPONENT_REMOVED; public static final intCONTAINER_FIRST; public static final intCONTAINER_LAST; //Public Instance Methodspublic ComponentgetChild(); public ContainergetContainer(); public StringparamString(); //Overrides ComponentEvent}
Hierarchy:
Object->EventObject(Serializable)->AWTEvent->ComponentEvent->ContainerEvent
Passed To:
AWTEventMulticaster.componentAdded(), AWTEventMulticaster.componentRemoved(), Container.processContainerEvent(), ContainerAdapter.componentAdded(), ContainerAdapter.componentRemoved(), ContainerListener.componentAdded(), ContainerListener.componentRemoved()