Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.event

Class ComponentEvent

java.lang.Object
|
+--java.util.EventObject
   |
   +--java.awt.AWTEvent
      |
      +--java.awt.event.ComponentEvent


public class ComponentEvent

extends 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:See Also:

Field Summary

static intCOMPONENT_FIRST

This is the first id in the range of ids used by this class.
static intCOMPONENT_HIDDEN

This id indicates that a component was hidden.
static intCOMPONENT_LAST

This is the last id in the range of ids used by this class.
static intCOMPONENT_MOVED

This id indicates that a component was moved.
static intCOMPONENT_RESIZED

This id indicates that a component was resized.
static intCOMPONENT_SHOWN

This id indicates that a component was shown.

Constructor Summary

ComponentEvent(java.awt.Component source, int id)

Initializes a new instance of ComponentEvent with the specified source and id.

Method Summary

java.awt.ComponentgetComponent()

This method returns the event source as a Component.
java.lang.StringparamString()

This method returns a string identifying this event.

Field Details

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.


Constructor Details

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:


Method Details

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:


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: