TextComponent (Java Platform SE 8 ) (original) (raw)

Modifier and Type

Method

Description

void

[addNotify](../../java/awt/TextComponent.html#addNotify--)()

Makes this Component displayable by connecting it to a native screen resource.

void

[addTextListener](../../java/awt/TextComponent.html#addTextListener-java.awt.event.TextListener-)([TextListener](../../java/awt/event/TextListener.html "interface in java.awt.event") l)

Adds the specified text event listener to receive text events from this text component.

void

[enableInputMethods](../../java/awt/TextComponent.html#enableInputMethods-boolean-)(boolean enable)

Enables or disables input method support for this text component.

[AccessibleContext](../../javax/accessibility/AccessibleContext.html "class in javax.accessibility")

[getAccessibleContext](../../java/awt/TextComponent.html#getAccessibleContext--)()

Gets the AccessibleContext associated with this TextComponent.

[Color](../../java/awt/Color.html "class in java.awt")

[getBackground](../../java/awt/TextComponent.html#getBackground--)()

Gets the background color of this text component.

int

[getCaretPosition](../../java/awt/TextComponent.html#getCaretPosition--)()

Returns the position of the text insertion caret.

[InputMethodRequests](../../java/awt/im/InputMethodRequests.html "interface in java.awt.im")

[getInputMethodRequests](../../java/awt/TextComponent.html#getInputMethodRequests--)()

Gets the input method request handler which supports requests from input methods for this component.

<T extends [EventListener](../../java/util/EventListener.html "interface in java.util")> T[]

[getListeners](../../java/awt/TextComponent.html#getListeners-java.lang.Class-)([Class](../../java/lang/Class.html "class in java.lang")<T> listenerType)

Returns an array of all the objects currently registered as _Foo_Listeners upon this TextComponent.

[String](../../java/lang/String.html "class in java.lang")

[getSelectedText](../../java/awt/TextComponent.html#getSelectedText--)()

Returns the selected text from the text that is presented by this text component.

int

[getSelectionEnd](../../java/awt/TextComponent.html#getSelectionEnd--)()

Gets the end position of the selected text in this text component.

int

[getSelectionStart](../../java/awt/TextComponent.html#getSelectionStart--)()

Gets the start position of the selected text in this text component.

[String](../../java/lang/String.html "class in java.lang")

[getText](../../java/awt/TextComponent.html#getText--)()

Returns the text that is presented by this text component.

[TextListener](../../java/awt/event/TextListener.html "interface in java.awt.event")[]

[getTextListeners](../../java/awt/TextComponent.html#getTextListeners--)()

Returns an array of all the text listeners registered on this text component.

boolean

[isEditable](../../java/awt/TextComponent.html#isEditable--)()

Indicates whether or not this text component is editable.

protected [String](../../java/lang/String.html "class in java.lang")

[paramString](../../java/awt/TextComponent.html#paramString--)()

Returns a string representing the state of thisTextComponent.

protected void

[processEvent](../../java/awt/TextComponent.html#processEvent-java.awt.AWTEvent-)([AWTEvent](../../java/awt/AWTEvent.html "class in java.awt") e)

Processes events on this text component.

protected void

[processTextEvent](../../java/awt/TextComponent.html#processTextEvent-java.awt.event.TextEvent-)([TextEvent](../../java/awt/event/TextEvent.html "class in java.awt.event") e)

Processes text events occurring on this text component by dispatching them to any registered TextListener objects.

void

[removeNotify](../../java/awt/TextComponent.html#removeNotify--)()

Removes the TextComponent's peer.

void

[removeTextListener](../../java/awt/TextComponent.html#removeTextListener-java.awt.event.TextListener-)([TextListener](../../java/awt/event/TextListener.html "interface in java.awt.event") l)

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](../../java/awt/TextComponent.html#select-int-int-)(int selectionStart, int selectionEnd)

Selects the text between the specified start and end positions.

void

[selectAll](../../java/awt/TextComponent.html#selectAll--)()

Selects all the text in this text component.

void

[setBackground](../../java/awt/TextComponent.html#setBackground-java.awt.Color-)([Color](../../java/awt/Color.html "class in java.awt") c)

Sets the background color of this text component.

void

[setCaretPosition](../../java/awt/TextComponent.html#setCaretPosition-int-)(int position)

Sets the position of the text insertion caret.

void

[setEditable](../../java/awt/TextComponent.html#setEditable-boolean-)(boolean b)

Sets the flag that determines whether or not this text component is editable.

void

[setSelectionEnd](../../java/awt/TextComponent.html#setSelectionEnd-int-)(int selectionEnd)

Sets the selection end for this text component to the specified position.

void

[setSelectionStart](../../java/awt/TextComponent.html#setSelectionStart-int-)(int selectionStart)

Sets the selection start for this text component to the specified position.

void

[setText](../../java/awt/TextComponent.html#setText-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") t)

Sets the text that is presented by this text component to be the specified text.