TextArea control. Additionally, if you want
a form of rich-text editing, there is also the
HTMLEditor control.
TextField supports the notion of showing prompt text
to the user when there is no text already in the
TextField (either via the user, or set programmatically). This is a useful
way of informing the user as to what is expected in the text field, without
having to resort to tooltips or on-screen labels.
Example:
var textField = new TextField("Hello World!");
TextArea
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | |
| public static final int | DEFAULT_PREF_COLUMN_COUNT
The default value for |
| private ObjectProperty | onAction
The action handler associated with this text field, or
|
| private IntegerProperty | prefColumnCount
The preferred number of text columns. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | Returns: the alignment propertySpecifies how the text should be aligned when there is empty space within the TextField. |
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| pack-priv String | |
| public final Pos | |
| public CharSequence | Returns: the character sequence backing the text field's contentReturns the character sequence backing the text field's content. |
| public static List | Returns: theCssMetaDataHides javafx. Gets the |
| public List | getControlCssMetaData()
Overrides javafx. Gets the unmodifiable list of the control's CSS-styleable properties. |
| public final EventHandler | |
| public final int | |
| public final ObjectProperty | |
| public final IntegerProperty | |
| public final void | |
| public final void | |
| public final void |
| alignment | back to summary |
|---|---|
| private ObjectProperty<Pos> alignment | |
| DEFAULT_PREF_COLUMN_COUNT | back to summary |
|---|---|
| public static final int DEFAULT_PREF_COLUMN_COUNT The default value for | |
| onAction | back to summary |
|---|---|
| private ObjectProperty<EventHandler<ActionEvent>> onAction The action handler associated with this text field, or
| |
| prefColumnCount | back to summary |
|---|---|
| private IntegerProperty prefColumnCount The preferred number of text columns. This is used for
calculating the | |
| TextField | back to summary |
|---|---|
| public TextField() Creates a | |
| TextField | back to summary |
|---|---|
| public TextField(String text) Creates a
| |
| alignmentProperty | back to summary |
|---|---|
| public final ObjectProperty Specifies how the text should be aligned when there is empty space within the TextField.
| |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. Create a new instance of the default skin for this control. This is called to create a skin for the control if
no skin is provided via CSS | |
| filterInput | back to summary |
|---|---|
| pack-priv String filterInput(String text) Overrides javafx.
| |
| getAlignment | back to summary |
|---|---|
| public final Pos getAlignment() | |
| getCharacters | back to summary |
|---|---|
| public CharSequence getCharacters() Returns the character sequence backing the text field's content.
| |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Hides javafx. Gets the
| |
| getControlCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Doc from javafx. Gets the unmodifiable list of the control's CSS-styleable properties.
| |
| getOnAction | back to summary |
|---|---|
| public final EventHandler | |
| getPrefColumnCount | back to summary |
|---|---|
| public final int getPrefColumnCount() | |
| onActionProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| prefColumnCountProperty | back to summary |
|---|---|
| public final IntegerProperty prefColumnCountProperty() | |
| setAlignment | back to summary |
|---|---|
| public final void setAlignment(Pos value) | |
| setOnAction | back to summary |
|---|---|
| public final void setOnAction(EventHandler<ActionEvent> value) | |
| setPrefColumnCount | back to summary |
|---|---|
| public final void setPrefColumnCount(int value) | |
| Modifier and Type | Field and Description |
|---|---|
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final List |
| Access | Constructor and Description |
|---|---|
| private |
| ALIGNMENT | back to summary |
|---|---|
| private static final CssMetaData<TextField, Pos> ALIGNMENT | |
| PREF_COLUMN_COUNT | back to summary |
|---|---|
| private static final CssMetaData<TextField, Number> PREF_COLUMN_COUNT | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| StyleableProperties | back to summary |
|---|---|
| private StyleableProperties() | |
| Modifier and Type | Field and Description |
|---|---|
| private StringBuilder |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | delete(int
the start start, int the end end, boolean the notify listener flag notifyListeners)Implements javafx. Removes a sequence of characters from the content. |
| public String | get(int
the start start, int the end end)Implements javafx. Retrieves a subset of the content. |
| public String | get()
Implements javafx. Returns the current value of this |
| public String | getValue()
Implements javafx. Returns the current value of this |
| public void | insert(int
the index index, String the text string text, boolean the notify listener flag notifyListeners)Implements javafx. Inserts a sequence of characters into the content. |
| public int | length()
Implements javafx. Returns the number of characters represented by the content. |
| characters | back to summary |
|---|---|
| private StringBuilder characters | |
| TextFieldContent | back to summary |
|---|---|
| private TextFieldContent() | |
| delete | back to summary |
|---|---|
| public void delete(int start, int end, boolean notifyListeners) Implements javafx. Doc from javafx. Removes a sequence of characters from the content.
| |
| get | back to summary |
|---|---|
| public String get(int start, int end) Implements javafx. Doc from javafx. Retrieves a subset of the content. | |
| get | back to summary |
|---|---|
| public String get() Implements javafx. Doc from javafx. Returns the current value of this | |
| getValue | back to summary |
|---|---|
| public String getValue() Implements javafx. Doc from javafx. Returns the current value of this | |
| insert | back to summary |
|---|---|
| public void insert(int index, String text, boolean notifyListeners) Implements javafx. Doc from javafx. Inserts a sequence of characters into the content. | |
| length | back to summary |
|---|---|
| public int length() Implements javafx. Doc from javafx. Returns the number of characters represented by the content.
| |