java.awt.event
Class ComponentEvent
java.lang.Object
|
+--java.util.EventObject
|
+--java.awt.AWTEvent
|
+--java.awt.event.ComponentEvent
public class
ComponentEventextends
AWTEvent This class is for events generated when a component is moved, resized,
hidden, or shown. These events normally do not need to be handled by the
application, since the AWT system automatically takes care of them. This
is also the superclass for other events on components, but
ComponentListeners ignore such subclasses.
Since:Author:- Aaron M. Renn <arenn@urbanophile.com>
See Also:
COMPONENT_FIRST
public static final int COMPONENT_FIRST
This is the first id in the range of ids used by this class.
COMPONENT_HIDDEN
public static final int COMPONENT_HIDDEN
This id indicates that a component was hidden.
COMPONENT_LAST
public static final int COMPONENT_LAST
This is the last id in the range of ids used by this class.
COMPONENT_MOVED
public static final int COMPONENT_MOVED
This id indicates that a component was moved.
COMPONENT_RESIZED
public static final int COMPONENT_RESIZED
This id indicates that a component was resized.
COMPONENT_SHOWN
public static final int COMPONENT_SHOWN
This id indicates that a component was shown.
ComponentEvent
public ComponentEvent(java.awt.Component source, int id)
Initializes a new instance of ComponentEvent
with the
specified source and id. Note that an invalid id leads to unspecified
results.
Parameters:
Throws:
getComponent
public Component getComponent()
This method returns the event source as a Component
. If the
source has subsequently been modified to a non-Component, this returns
null.
Returns:
- the event source as a
Component
, or null
paramString
public String paramString()
This method returns a string identifying this event. This is the field
name of the id type, and for COMPONENT_MOVED or COMPONENT_RESIZED, the
new bounding box of the component.
Returns:
- a string identifying this event