
 |
Chapter 19 java.awt Reference |
 |
TextComponent
Name
TextComponent
The abstract TextComponent
class provides the base class for the text input components, TextArea
and TextField.
- Parameters
-
- l
-
An object that implements the TextListener
interface.
- Description
-
Add a listener for the text events.
- Returns
-
The position, in characters, of the caret (text cursor).
- Returns
-
The currently selected text of the TextComponent.
- Returns
-
The ending cursor position of any selected text.
- Returns
-
The initial position of any selected text.
- Returns
-
Current contents of the TextComponent.
- Returns
-
true if editable, false
otherwise.
- Description
-
Destroys the peer of the TextComponent.
- Parameters
-
- l
-
One of this TextComponent's
TextListeners.
- Description
-
Remove a text event listener.
- Parameters
-
- selectionStart
-
Beginning position of text to select.
- selectionEnd
-
Ending position of text to select.
- Description
-
Selects text in the TextComponent.
- Description
-
Selects all the text in the TextComponent.
- Parameters
-
- position
-
The new character position for the caret.
- Throws
-
- IllegalArgumentException
-
If
position is less than zero.
- Description
-
Allows you to change the location of the caret.
- Parameters
-
- state
-
true to allow
the user to edit the text in the TextComponent;
false to prevent editing.
- Description
-
Allows you to make the TextComponent
editable or read-only.
- Parameters
-
- selectionEnd
-
The character position of the end of the selection.
- Description
-
Allows you to change the location of the end of the selected text.
- Parameters
-
- selectionStart
-
The character position of the start of the selection.
- Description
-
Allows you to change the location of the start of the selected text.
- Parameters
-
- text
-
New text for TextComponent.
- Description
-
Sets the content of the TextComponent.
- Returns
-
String with current settings of TextComponent.
- Overrides
-
Component.paramString()
- Description
-
Helper method for toString()
to generate string of current settings.
- Parameters
-
- e
-
The event to process.
- Description
-
Low-level AWTEvents are passed
to this method for processing.
- Parameters
-
- e
-
The event to process.
- Description
-
Text events are passed to this method for processing. Normally, this method
is called by processEvent().
Component, TextArea,
TextField, String
|
|