[118:7] extends: Control
TextInputControl is the abstract base class for all JavaFX text input controls, including
TextField, TextArea, and PasswordField. It provides the core API for reading and writing
text content, managing text selection, and responding to text change events. The class
defines the CSS properties that govern font, text color, prompt text, and selection
highlight appearance shared by every text input control. A readonly pseudo-class is
applied automatically when the control's editable property is false.
The tables below list every CSS property available to TextInputControl, organized by the
class level where each property is defined. Properties defined at a higher level are
inherited by all subclasses below it.
| Pseudo-class | Description |
|---|---|
readonly |
Applies when the control is not editable (editable is false). |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-font |
<font> |
null (inherits) |
Font used to render the input text. |
-fx-text-fill |
<paint> |
black |
Color of the input text. |
-fx-prompt-text-fill |
<paint> |
gray |
Color of the prompt (placeholder) text shown when the field is empty. |
-fx-highlight-fill |
<paint> |
dodgerblue |
Background fill color of selected text. |
-fx-highlight-text-fill |
<paint> |
white |
Text color of selected text. |
-fx-display-caret |
true | false |
true |
When true, the text insertion caret is displayed. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-skin |
<string> |
null |
Fully qualified class name of the Skin to use for rendering this control. |
-fx-focus-traversable |
true | false |
true |
When true, the control participates in focus traversal via the keyboard Tab key. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-background-color |
<paint> [, <paint>]* |
transparent |
One or more paint values for background fill layers, rendered back to front. |
-fx-background-insets |
<size> or <t> <r> <b> <l> [, ...]* |
0 0 0 0 |
Insets from the region edges for each background fill layer. |
-fx-background-radius |
<size> [/ <size>]* [, ...]* |
0 0 0 0 |
Corner radii for each background fill layer. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-background-image |
<uri> [, <uri>]* |
null |
One or more image URIs for background image layers. |
-fx-background-position |
<bg-position> [, ...]* |
0% 0% |
Position of each background image within the region. Accepts keywords or size values. |
-fx-background-repeat |
<repeat-style> [, ...]* |
repeat repeat |
Tiling behavior for each background image. Values: repeat, no-repeat, round, space applied per axis. |
-fx-background-size |
<bg-size> [, ...]* |
auto auto |
Dimensions for each background image. Supports cover, contain, stretch, or explicit sizes. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-border-color |
<paint> or <t> <r> <b> <l> [, ...]* |
null |
Paint colors for the border stroke layers. |
-fx-border-insets |
<size> or <t> <r> <b> <l> [, ...]* |
null |
Insets from region edges for each border layer. |
-fx-border-radius |
<size> [, ...]* |
null |
Corner radii for border stroke layers. |
-fx-border-style |
<border-style> [, ...]* |
null |
Border line style (solid, dotted, dashed) plus phase and line cap/join options per layer. |
-fx-border-width |
<size> or <t> <r> <b> <l> [, ...]* |
null |
Thickness of each border stroke layer, per side. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-border-image-source |
<uri> [, <uri>]* |
null |
Image URIs used to paint the border. |
-fx-border-image-insets |
<size> or <t> <r> <b> <l> [, ...]* |
0 0 0 0 |
Insets for each border image layer. |
-fx-border-image-repeat |
<repeat-style> [, ...]* |
repeat repeat |
Tiling behavior for each border image. |
-fx-border-image-slice |
<size> or <t> <r> <b> <l> [fill] [, ...]* |
100% |
Divides each border image into nine regions. Adding fill preserves the center region. |
-fx-border-image-width |
<size> or <t> <r> <b> <l> [, ...]* |
1 1 1 1 |
Width of each border image slice per side. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-padding |
<size> or <t> <r> <b> <l> |
0 0 0 0 |
Interior padding between the region border and its content. |
-fx-shape |
<string> |
null |
SVG path string that defines a custom clip shape for the region. |
-fx-scale-shape |
true | false |
true |
When true, the shape is scaled to fit the region. |
-fx-position-shape |
true | false |
true |
When true, the shape is centered within the region. |
-fx-snap-to-pixel |
true | false |
true |
When true, positions and sizes are rounded to whole pixel boundaries. |
-fx-min-width |
<size> |
-1 |
Minimum width. -1 uses the computed minimum. |
-fx-pref-width |
<size> |
-1 |
Preferred width. -1 uses the computed preferred. |
-fx-max-width |
<size> |
-1 |
Maximum width. -1 uses the computed maximum. |
-fx-min-height |
<size> |
-1 |
Minimum height. -1 uses the computed minimum. |
-fx-pref-height |
<size> |
-1 |
Preferred height. -1 uses the computed preferred. |
-fx-max-height |
<size> |
-1 |
Maximum height. -1 uses the computed maximum. |
| Property | Values | Default | Description |
|---|---|---|---|
-fx-blend-mode |
add | blue | color-burn | color-dodge | darken | difference | exclusion | green | hard-light | lighten | multiply | overlay | red | screen | soft-light | src-atop | src-in | src-out | src-over |
null |
Blend mode used when compositing this node with nodes beneath it. |
-fx-cursor |
null | crosshair | default | hand | move | e-resize | h-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | v-resize | text | wait | <url> |
null (inherits) |
Mouse cursor shape shown when the pointer is over this node. Inherits from parent by default. |
-fx-effect |
<effect> |
null |
A visual effect (e.g. DropShadow, InnerShadow) applied to the rendered node. |
-fx-focus-traversable |
true | false |
false |
Whether this node participates in focus traversal. Overridden to true by Control. |
-fx-view-order |
<number> |
0 |
Adjusts rendering and hit-test order within the parent without changing the scene graph order. |
-fx-opacity |
<number> [0.0 - 1.0] |
1 |
Opacity of the node. 0 is fully transparent, 1 is fully opaque. |
-fx-rotate |
<number> |
0 |
Rotation angle in degrees applied around the node's center point. Positive values are clockwise. |
-fx-scale-x |
<number> |
1 |
Scale factor along the X axis about the node's center. |
-fx-scale-y |
<number> |
1 |
Scale factor along the Y axis about the node's center. |
-fx-scale-z |
<number> |
1 |
Scale factor along the Z axis about the node's center. |
-fx-translate-x |
<number> |
0 |
Translation offset along the X axis in pixels. |
-fx-translate-y |
<number> |
0 |
Translation offset along the Y axis in pixels. |
-fx-translate-z |
<number> |
0 |
Translation offset along the Z axis in pixels. |
visibility |
visible | hidden | collapse | inherit |
visible |
Controls whether the node is rendered and participates in layout. collapse removes it from layout; hidden keeps the space. |
-fx-managed |
true | false |
true |
When false, the parent layout does not manage this node's position or size. |
setText (string Text)
Sets the text content of the text input control.
Text is a string to set as the current content of the control.this object for chaininggetText ()
Retrieves the current text content of the text input control.
A string with the current text in the control.onChange (callback OnChange)
Sets a callback function that triggers when the text content changes.
OnChange The callback function for handling text change events.this object for chainingfontProperty ()
Returns the font ObjectProperty for binding.
An AJO around the ObjectProperty.setFont (object FontObj)
Sets the font used to render the input text.
FontObj is a Font wrapper object.this object for chaininggetFont ()
Returns the current font used to render text.
An AJO around a javafx.scene.text.Font.promptTextProperty ()
Returns the promptText StringProperty for binding.
An AJO around the StringProperty.getPromptText ()
Returns the placeholder prompt text shown when the field is empty.
A string with the prompt text.setPromptText (string Text)
Sets the placeholder prompt text shown when the field is empty.
Text is a string with the prompt to display.this object for chainingtextFormatterProperty ()
Returns the textFormatter ObjectProperty for binding.
An AJO around the ObjectPropertygetTextFormatter ()
Returns the current TextFormatter that governs text input.
An AJO around the TextFormatter, or null.setTextFormatter (object Formatter)
Sets the TextFormatter that governs text input filtering and value conversion.
Formatter is an AJO around a javafx.scene.control.TextFormatter.this object for chainingtextProperty ()
Returns the text StringProperty for binding.
An AJO around the StringProperty.getLength ()
Returns the length of the text content in characters.
An int with the number of characters.lengthProperty ()
Returns the length ReadOnlyIntegerProperty for binding.
An AJO around the ReadOnlyIntegerProperty.isEditable ()
Returns whether the control is editable.
A bool with true if editable.setEditable (bool Value)
Sets whether the control is editable.
Value is a bool with true to allow editing.this object for chainingeditableProperty ()
Returns the editable BooleanProperty for binding.
An AJO around the BooleanProperty.getSelection ()
Returns the current selection as an IndexRange.
An AJO around the javafx.scene.control.IndexRange.selectionProperty ()
Returns the selection ReadOnlyObjectProperty for binding.
An AJO around the ReadOnlyObjectPropertygetSelectedText ()
Returns the currently selected text content.
A string with the selected text.selectedTextProperty ()
Returns the selectedText ReadOnlyStringProperty for binding.
An AJO around the ReadOnlyStringProperty.getAnchor ()
Returns the anchor character position of the current selection.
An int with the anchor position.anchorProperty ()
Returns the anchor ReadOnlyIntegerProperty for binding.
An AJO around the ReadOnlyIntegerProperty.getCaretPosition ()
Returns the current caret character position.
An int with the caret position.caretPositionProperty ()
Returns the caretPosition ReadOnlyIntegerProperty for binding.
An AJO around the ReadOnlyIntegerProperty.isUndoable ()
Returns whether the most recent operation can be undone.
A bool with true if an undo is available.undoableProperty ()
Returns the undoable ReadOnlyBooleanProperty for binding.
An AJO around the ReadOnlyBooleanProperty.isRedoable ()
Returns whether the most recent undo can be redone.
A bool with true if a redo is available.redoableProperty ()
Returns the redoable ReadOnlyBooleanProperty for binding.
An AJO around the ReadOnlyBooleanProperty.appendText (string Text)
Appends the given text to the end of the current content.
Text is a string to append.this object for chaininginsertText (int Index, string Text)
Inserts text at the specified character index.
Index is an int with the insertion position.Text is a string to insert.this object for chainingdeleteText (int Start, int End)
Deletes the character range starting at Start and ending at End.
Start is an int with the start character index.End is an int with the end character index (exclusive).this object for chainingreplaceText (int Start, int End, string Text)
Replaces the character range with new text.
Start is an int with the start character index.End is an int with the end character index (exclusive).Text is a string with the replacement content.this object for chainingcut ()
Cuts the current selection to the clipboard.
this object for chainingcopy ()
Copies the current selection to the clipboard.
this object for chainingpaste ()
Pastes the clipboard contents at the caret position.
this object for chainingselectBackward ()
Extends the selection one character backward.
this object for chainingselectForward ()
Extends the selection one character forward.
this object for chainingpreviousWord ()
Moves the caret to the start of the previous word.
this object for chainingnextWord ()
Moves the caret to the start of the next word.
this object for chainingendOfNextWord ()
Moves the caret to the end of the next word.
this object for chainingselectPreviousWord ()
Extends the selection to the start of the previous word.
this object for chainingselectNextWord ()
Extends the selection to the start of the next word.
this object for chainingselectEndOfNextWord ()
Extends the selection to the end of the next word.
this object for chainingselectAll ()
Selects all of the text content.
this object for chaininghome ()
Moves the caret to the start of the content.
this object for chainingend ()
Moves the caret to the end of the content.
this object for chainingselectHome ()
Extends the selection to the start of the content.
this object for chainingselectEnd ()
Extends the selection to the end of the content.
this object for chainingdeletePreviousChar ()
Deletes the character before the caret.
A bool with true if a character was deleted.deleteNextChar ()
Deletes the character after the caret.
A bool with true if a character was deleted.forward ()
Moves the caret forward one character.
this object for chainingbackward ()
Moves the caret backward one character.
this object for chainingpositionCaret (int Pos)
Moves the caret to the given character position without selecting.
Pos is an int with the new caret position.this object for chainingselectPositionCaret (int Pos)
Moves the caret to the given position and extends the selection.
Pos is an int with the new caret position.this object for chainingselectRange (int Anchor, int Caret)
Selects the character range from Anchor to Caret.
Anchor is an int with the anchor position.Caret is an int with the caret position.this object for chainingextendSelection (int Pos)
Extends the selection from the current anchor to the given position.
Pos is an int with the new caret position.this object for chainingclear ()
Clears the entire text content.
this object for chainingdeselect ()
Clears the current selection without changing the caret position.
this object for chainingreplaceSelection (string Text)
Replaces the current selection with the given text.
Text is a string with the replacement content.this object for chainingundo ()
Undoes the most recent text edit.
this object for chainingredo ()
Redoes the most recently undone text edit.
this object for chainingcommitValue ()
Commits the current value through any active text formatter.
this object for chainingcancelEdit ()
Cancels any in-progress edit and reverts to the last committed value.
this object for chaininggetControlCssMetaData ()
Returns the CSS metadata for this control's styleable properties.
A list of CssMetaData entries.