public class

TextEvent

extends AWTEvent
java.lang.Object
   ↳ java.util.EventObject
     ↳ java.awt.AWTEvent
       ↳ java.awt.event.TextEvent

Class Overview

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".

Summary

Constants
int TEXT_FIRST The first number in the range of ids used for text events.
int TEXT_LAST The last number in the range of ids used for text events.
int TEXT_VALUE_CHANGED This event id indicates that object's text changed.
[Expand]
Inherited Constants
From class java.awt.AWTEvent
[Expand]
Inherited Fields
From class java.awt.AWTEvent
From class java.util.EventObject
Public Constructors
TextEvent(Object source, int id)
Constructs a TextEvent object.
Public Methods
String paramString()
Returns a parameter string identifying this text event.
[Expand]
Inherited Methods
From class java.awt.AWTEvent
From class java.util.EventObject
From class java.lang.Object

Constants

public static final int TEXT_FIRST

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

Constant Value: 900 (0x00000384)

public static final int TEXT_LAST

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

Constant Value: 900 (0x00000384)

public static final int TEXT_VALUE_CHANGED

This event id indicates that object's text changed.

Constant Value: 900 (0x00000384)

Public Constructors

public TextEvent (Object source, int id)

Constructs a TextEvent object.

Note that passing in an invalid id results in unspecified behavior. This method throws an IllegalArgumentException if source is null.

Parameters
source the (TextComponent) object that originated the event
id an integer that identifies the event type
Throws
IllegalArgumentException if source is null

Public Methods

public String paramString ()

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

Returns
  • a string identifying the event and its attributes