Class TextArea

java.lang.Object
All Implemented Interfaces:
Styleable, EventTarget, Skinnable

public class TextArea extends TextInputControl
Text input component that allows a user to enter multiple lines of plain text. Unlike in previous releases of JavaFX, support for single line input is not available as part of the TextArea control, however this is the sole-purpose of the 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.

Example:

 var textArea = new TextArea("Lorem ipsum dolor sit amet, consectetur adipiscing elit, "
        + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim "
        + "ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip "
        + "ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate "
        + "velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat "
        + "cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.");
 textArea.setWrapText(true);
Image of the TextArea control
Since:
JavaFX 2.0
See Also: