|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.ComponentEvent
java.awt.event.ContainerEvent
public class ContainerEvent
This event is generated when a component is added or removed from a container. Applications do not ordinarily need to handle these events since the AWT system handles them internally.
ContainerAdapter,
ContainerListener,
Serialized Form| Field Summary | |
|---|---|
static int |
COMPONENT_ADDED
This id indicates a component was added to the container. |
static int |
COMPONENT_REMOVED
This id indicates a component was removed from the container. |
static int |
CONTAINER_FIRST
This is the first id in the id range used by this class. |
static int |
CONTAINER_LAST
This is the last id in the id range used by this class. |
| Fields inherited from class java.awt.event.ComponentEvent |
|---|
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN |
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
ContainerEvent(Component source,
int id,
Component child)
Initializes a new instance of ContainerEvent with the
specified source and id. |
|
| Method Summary | |
|---|---|
Component |
getChild()
This method returns the child object that was added or removed from the container. |
Container |
getContainer()
Returns the source of this event as a Container. |
String |
paramString()
This method returns a string identifying this event. |
| Methods inherited from class java.awt.event.ComponentEvent |
|---|
getComponent |
| Methods inherited from class java.awt.AWTEvent |
|---|
consume, getID, isConsumed, setSource, toString |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CONTAINER_FIRST
public static final int CONTAINER_LAST
public static final int COMPONENT_ADDED
public static final int COMPONENT_REMOVED
| Constructor Detail |
|---|
public ContainerEvent(Component source,
int id,
Component child)
ContainerEvent with the
specified source and id. Additionally, the affected child component
is also passed as a parameter. Note that an invalid id leads to
unspecified results.
source - the source container of the eventid - the event idchild - the child component affected by this event
IllegalArgumentException - if source is null| Method Detail |
|---|
public Container getContainer()
Container.
ClassCastException - if the source is changed to a non-Containerpublic Component getChild()
public String paramString()
(getID() == COMPONENT_ADDED ? "COMPONENT_ADDED"
: "COMPONENT_REMOVED") + ",child=" + getChild().getName().
paramString in class ComponentEvent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||