Javafx fxml file TextArea line break and tab in text

Sevi picture Sevi · Jan 22, 2015 · Viewed 7.1k times · Source

How to edit text in the TextArea in `.fxml file as such I can use line breaks and tabs. The Textarea is predefined and can not be edited.

Images to support

FXML File

FXML File

The View

The View

Answer

ItachiUchiha picture ItachiUchiha · Jan 22, 2015

If you want to directly use the text you can use something :

<TextArea prefHeight="200.0" prefWidth="200.0" text="${'Multi\nLine\tTab'}" />

In case you want to use in Scene Builder, you can switch to multi-line mode.

enter image description here

Switching to multi-line mode, scene builder will insert:

&#10; for \n 
&#9;  for \t