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 Fields |
From class
java.awt.AWTEvent
protected
boolean |
consumed |
Controls whether or not the event is sent back down to the peer once the
source has processed it - false means it's sent to the peer; true means
it's not. |
protected
int |
id |
The event's id.@serial |
|
From class
java.util.EventObject
protected
Object |
source |
The object on which the Event initially occurred. |
|
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
void
|
consume()
Consumes this event, if this event can be consumed.
|
int
|
getID()
Returns the event type.
|
boolean
|
isConsumed()
Returns whether this event has been consumed.
|
String
|
paramString()
Returns a string representing the state of this Event .
|
void
|
setSource(Object newSource)
Retargets an event to a new source.
|
String
|
toString()
Returns a String representation of this object.
|
|
From class
java.util.EventObject
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
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 |
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