APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt.event

public Class TextEvent

extends AWTEvent
Class Inheritance
Imports
java.awt.AWTEvent, java.io.Serial

A semantic event which indicates that an object's text changed. This high-level event is generated by an object (such as a TextComponent) when its text changes. The event is passed to every TextListener object which registered to receive such events using the component's addTextListener method.

The object that implements the TextListener interface gets this TextEvent when the event occurs. The listener is spared the details of processing individual mouse movements and key strokes Instead, it can process a "meaningful" (semantic) event like "text changed".

An unspecified behavior will be caused if the id parameter of any particular TextEvent instance is not in the range from TEXT_FIRST to TEXT_LAST.

Author
Georges Saab
Since
1.1
See Also
java.awt.TextComponent, TextListener

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Hides java.awt.AWTEvent.serialVersionUID.

Use serialVersionUID from JDK 1.1 for interoperability.
public static final int
TEXT_FIRST

The first number in the range of ids used for text events.

public static final int
TEXT_LAST

The last number in the range of ids used for text events.

public static final int
TEXT_VALUE_CHANGED

This event id indicates that object's text changed.

Inherited from java.awt.AWTEvent:
ACTION_EVENT_MASKADJUSTMENT_EVENT_MASKCOMPONENT_EVENT_MASKconsumedCONTAINER_EVENT_MASKFOCUS_EVENT_MASKHIERARCHY_BOUNDS_EVENT_MASKHIERARCHY_EVENT_MASKidINPUT_METHOD_EVENT_MASKINVOCATION_EVENT_MASKITEM_EVENT_MASKKEY_EVENT_MASKMOUSE_EVENT_MASKMOUSE_MOTION_EVENT_MASKMOUSE_WHEEL_EVENT_MASKPAINT_EVENT_MASKRESERVED_ID_MAXTEXT_EVENT_MASKWINDOW_EVENT_MASKWINDOW_FOCUS_EVENT_MASKWINDOW_STATE_EVENT_MASK

Constructor Summary

AccessConstructor and Description
public
TextEvent(Object
The (TextComponent) object that originated the event
source
,
int
An integer that identifies the event type. For information on allowable values, see the class description for TextEvent
id
)

Constructs a TextEvent object.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a string identifying the event and its attributes
paramString
()

Overrides java.awt.AWTEvent.paramString.

Returns a parameter string identifying this text event.

Inherited from java.awt.AWTEvent:
consumegetIDisConsumedsetSourcetoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.AWTEvent.serialVersionUID.

Use serialVersionUID from JDK 1.1 for interoperability.

Annotations
@Serial
TEXT_FIRSTback to summary
public static final int TEXT_FIRST

The first number in the range of ids used for text events.

TEXT_LASTback to summary
public static final int TEXT_LAST

The last number in the range of ids used for text events.

TEXT_VALUE_CHANGEDback to summary
public static final int TEXT_VALUE_CHANGED

This event id indicates that object's text changed.

Constructor Detail

TextEventback to summary
public TextEvent(Object source, int id)

Constructs a TextEvent object.

This method throws an IllegalArgumentException if source is null.

Parameters
source:Object

The (TextComponent) object that originated the event

id:int

An integer that identifies the event type. For information on allowable values, see the class description for TextEvent

Exceptions
IllegalArgumentException:
if source is null
See Also
getSource(), getID()

Method Detail

paramStringback to summary
public String paramString()

Overrides java.awt.AWTEvent.paramString.

Returns a parameter string identifying this text event. This method is useful for event-logging and for debugging.

Returns:String

a string identifying the event and its attributes