|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.TextComponent
, MenuContainer
, Serializable
, Accessible

, TextField

public class TextComponent


The TextComponent class is the superclass of
any component that allows the editing of some text.
A text component embodies a string of text. The
TextComponent class defines a set of methods
that determine whether or not this text is editable. If the
component is editable, it defines another set of methods
that supports a text insertion caret.
In addition, the class defines methods that are used to maintain a current selection from the text. The text selection, a substring of the component's text, is the target of editing operations. It is also referred to as the selected text.
| Nested Class Summary | |
|---|---|
protected class |
TextComponent.AccessibleAWTTextComponent
This class implements accessibility support for the TextComponent class. |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary | |
|---|---|
protected TextListener |
textListener
|
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Method Summary | ||
|---|---|---|
void |
addNotify
Makes this Component displayable by connecting it to a native screen resource. |
|
void |
addTextListener
Adds the specified text event listener to receive text events from this text component. |
|
void |
enableInputMethods
Enables or disables input method support for this component. |
|
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this TextComponent. |
|
Color |
getBackground
Gets the background color of this text component. |
|
int |
getCaretPosition
Returns the position of the text insertion caret. |
|
InputMethodRequests |
getInputMethodRequests
Gets the input method request handler which supports requests from input methods for this component. |
|
|
getListeners
Returns an array of all the objects currently registered as FooListeners
upon this TextComponent. |
|
String |
getSelectedText
Returns the selected text from the text that is presented by this text component. |
|
int |
getSelectionEnd
Gets the end position of the selected text in this text component. |
|
int |
getSelectionStart
Gets the start position of the selected text in this text component. |
|
String |
getText
Returns the text that is presented by this text component. |
|
TextListener |
getTextListeners
Returns an array of all the text listeners registered on this text component. |
|
boolean |
isEditable
Indicates whether or not this text component is editable. |
|
protected String |
paramString
Returns a string representing the state of this TextComponent. |
|
protected void |
processEvent
Processes events on this text component. |
|
protected void |
processTextEvent
Processes text events occurring on this text component by dispatching them to any registered TextListener objects. |
|
void |
removeNotify
Removes the TextComponent's peer. |
|
void |
removeTextListener
Removes the specified text event listener so that it no longer receives text events from this text component If l is null, no exception is
thrown and no action is performed. |
|
void |
select
Selects the text between the specified start and end positions. |
|
void |
selectAll
Selects all the text in this text component. |
|
void |
setBackground
Sets the background color of this text component. |
|
void |
setCaretPosition
Sets the position of the text insertion caret. |
|
void |
setEditable
Sets the flag that determines whether or not this text component is editable. |
|
void |
setSelectionEnd
Sets the selection end for this text component to the specified position. |
|
void |
setSelectionStart
Sets the selection start for this text component to the specified position. |
|
void |
setText
Sets the text that is presented by this text component to be the specified text. |
|