public class TextArea extends TextInputControl
TextField
control. Additionally, if you want
a form of rich-text editing, there is also the
HTMLEditor
control.
TextArea supports the notion of showing prompt text
to the user when there is no text
already in the
TextArea (either via the user, or set programmatically). This is a useful
way of informing the user as to what is expected in the text area, without
having to resort to tooltips
or on-screen labels
.
TextField
Type | Property and Description |
---|---|
IntegerProperty |
prefColumnCount
The preferred number of text columns.
|
IntegerProperty |
prefRowCount
The preferred number of text rows.
|
DoubleProperty |
scrollLeft
The number of pixels by which the content is horizontally
scrolled.
|
DoubleProperty |
scrollTop
The number of pixels by which the content is vertically
scrolled.
|
BooleanProperty |
wrapText
If a run of text exceeds the width of the
TextArea ,
then this variable indicates whether the text should wrap onto
another line. |
anchorProperty, caretPositionProperty, editableProperty, fontProperty, lengthProperty, promptTextProperty, redoableProperty, selectedTextProperty, selectionProperty, textFormatterProperty, textProperty, undoableProperty
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
Modifier and Type | Class and Description |
---|---|
private static class |
TextArea.ParagraphList |
private static class |
TextArea.ParagraphListChange |
private static class |
TextArea.StyleableProperties
*
Stylesheet Handling *
*
|
private static class |
TextArea.TextAreaContent |
TextInputControl.Content, TextInputControl.UndoRedoChange
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_PARAGRAPH_CAPACITY |
static int |
DEFAULT_PREF_COLUMN_COUNT
The default value for
prefColumnCount . |
static int |
DEFAULT_PREF_ROW_COUNT
The default value for
prefRowCount . |
private IntegerProperty |
prefColumnCount
The preferred number of text columns.
|
private IntegerProperty |
prefRowCount
The preferred number of text rows.
|
private DoubleProperty |
scrollLeft
The number of pixels by which the content is horizontally
scrolled.
|
private DoubleProperty |
scrollTop
The number of pixels by which the content is vertically
scrolled.
|
private BooleanProperty |
wrapText
If a run of text exceeds the width of the
TextArea ,
then this variable indicates whether the text should wrap onto
another line. |
Constructor and Description |
---|
TextArea()
Creates a
TextArea with empty text content. |
TextArea(java.lang.String text)
Creates a
TextArea with initial text content. |
Modifier and Type | Method and Description |
---|---|
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
static java.util.List<<any>> |
getClassCssMetaData() |
java.util.List<<any>> |
getControlCssMetaData() |
<any> |
getParagraphs()
Returns an unmodifiable list of the character sequences that back the
text area's content.
|
int |
getPrefColumnCount()
Gets the value of the property prefColumnCount.
|
int |
getPrefRowCount()
Gets the value of the property prefRowCount.
|
double |
getScrollLeft()
Gets the value of the property scrollLeft.
|
double |
getScrollTop()
Gets the value of the property scrollTop.
|
boolean |
isWrapText()
Gets the value of the property wrapText.
|
IntegerProperty |
prefColumnCountProperty()
The preferred number of text columns.
|
IntegerProperty |
prefRowCountProperty()
The preferred number of text rows.
|
DoubleProperty |
scrollLeftProperty()
The number of pixels by which the content is horizontally
scrolled.
|
DoubleProperty |
scrollTopProperty()
The number of pixels by which the content is vertically
scrolled.
|
void |
setPrefColumnCount(int value)
Sets the value of the property prefColumnCount.
|
void |
setPrefRowCount(int value)
Sets the value of the property prefRowCount.
|
void |
setScrollLeft(double value)
Sets the value of the property scrollLeft.
|
void |
setScrollTop(double value)
Sets the value of the property scrollTop.
|
void |
setWrapText(boolean value)
Sets the value of the property wrapText.
|
(package private) void |
textUpdated() |
BooleanProperty |
wrapTextProperty()
If a run of text exceeds the width of the
TextArea ,
then this variable indicates whether the text should wrap onto
another line. |
anchorProperty, appendText, backward, cancelEdit, caretPositionProperty, clear, commitValue, containsInvalidCharacters, copy, cut, deleteNextChar, deletePreviousChar, deleteText, deleteText, deselect, editableProperty, end, endOfNextWord, executeAccessibleAction, extendSelection, filterInput, fontProperty, forward, getAnchor, getCaretPosition, getContent, getFont, getLength, getPromptText, getSelectedText, getSelection, getText, getText, getTextFormatter, home, insertText, isEditable, isRedoable, isUndoable, lengthProperty, nextWord, paste, positionCaret, previousWord, promptTextProperty, queryAccessibleAttribute, redo, redoableProperty, replaceSelection, replaceText, replaceText, selectAll, selectBackward, selectedTextProperty, selectEnd, selectEndOfNextWord, selectForward, selectHome, selectionProperty, selectNextWord, selectPositionCaret, selectPreviousWord, selectRange, setEditable, setFont, setPromptText, setText, setTextFormatter, textFormatterProperty, textProperty, undo, undoableProperty
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public final BooleanProperty wrapTextProperty
TextArea
,
then this variable indicates whether the text should wrap onto
another line.isWrapText()
,
setWrapText(boolean)
public final IntegerProperty prefColumnCountProperty
TextArea
's preferred width.getPrefColumnCount()
,
setPrefColumnCount(int)
public final IntegerProperty prefRowCountProperty
TextArea
's preferred height.getPrefRowCount()
,
setPrefRowCount(int)
public final DoubleProperty scrollTopProperty
getScrollTop()
,
setScrollTop(double)
public final DoubleProperty scrollLeftProperty
getScrollLeft()
,
setScrollLeft(double)
public static final int DEFAULT_PREF_COLUMN_COUNT
prefColumnCount
.public static final int DEFAULT_PREF_ROW_COUNT
prefRowCount
.private static final int DEFAULT_PARAGRAPH_CAPACITY
private BooleanProperty wrapText
TextArea
,
then this variable indicates whether the text should wrap onto
another line.private IntegerProperty prefColumnCount
TextArea
's preferred width.private IntegerProperty prefRowCount
TextArea
's preferred height.private DoubleProperty scrollTop
private DoubleProperty scrollLeft
public TextArea()
TextArea
with empty text content.public TextArea(java.lang.String text)
TextArea
with initial text content.text
- A string for text content.final void textUpdated()
textUpdated
in class TextInputControl
public <any> getParagraphs()
public final BooleanProperty wrapTextProperty()
TextArea
,
then this variable indicates whether the text should wrap onto
another line.isWrapText()
,
setWrapText(boolean)
public final boolean isWrapText()
public final void setWrapText(boolean value)
public final IntegerProperty prefColumnCountProperty()
TextArea
's preferred width.getPrefColumnCount()
,
setPrefColumnCount(int)
public final int getPrefColumnCount()
public final void setPrefColumnCount(int value)
public final IntegerProperty prefRowCountProperty()
TextArea
's preferred height.getPrefRowCount()
,
setPrefRowCount(int)
public final int getPrefRowCount()
public final void setPrefRowCount(int value)
public final DoubleProperty scrollTopProperty()
getScrollTop()
,
setScrollTop(double)
public final double getScrollTop()
public final void setScrollTop(double value)
public final DoubleProperty scrollLeftProperty()
getScrollLeft()
,
setScrollLeft(double)
public final double getScrollLeft()
public final void setScrollLeft(double value)
protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.createDefaultSkin
in class Control
public static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getControlCssMetaData()
getControlCssMetaData
in class TextInputControl