TextField

A single-line text editor. For multiple lines, use TextArea.

Theme DSL

"text_field" {

    columns( value : Number )

    caretImage( image : Image )
    caretImage( images : NamedImages, imageName : String )

    font( value : Font )

    selectionColor( value : Color )
    selectionColor( value : String )

    textColor( value : Color )
    textColor( value : String )

}

TextField inherits all the features of Region.

Constructors

Link copied to clipboard
constructor(text: String = "")
constructor(stringProperty: StringProperty)
constructor(document: StringDocument)

Properties

Link copied to clipboard
Link copied to clipboard

Along with caretIndex, this defines the extent of the selection. If anchorIndex == caretIndex, then nothing is selected.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

If set to true, the prefColumnCount and minColumnCount will use the widths of digits, rather than the letter W to calculate evalPrefWidth and evalMinWidth.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Text to display when text is blank.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

If you bind this property, you should also set readOnly to true, as Themes may style a read-only TextArea differently. If this is bound, then the TextArea cannot be altered by the user regardless of readOnly.

Link copied to clipboard
open override val textSelected: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard
fun delete(from: Int, to: Int)
Link copied to clipboard
fun insert(from: Int, str: String)
Link copied to clipboard
open override fun nodeMinHeight(): Float

Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinHeight. The default implementation returns 0.

Link copied to clipboard
open override fun nodeMinWidth(): Float

Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinWidth. The default implementation returns 0.

Link copied to clipboard
open override fun nodePrefHeight(): Float

Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.

Link copied to clipboard
open override fun nodePrefWidth(): Float

Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun redo(): Change?
Link copied to clipboard
fun replace(from: Int, to: Int, str: String)
Link copied to clipboard
fun selectAll()
Link copied to clipboard
Link copied to clipboard
fun undo(): Change?