Javafx fxml file TextArea line break and tab in text

一世执手 提交于 2020-01-02 03:17:12

问题


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

The View


回答1:


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.

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

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


来源:https://stackoverflow.com/questions/28093508/javafx-fxml-file-textarea-line-break-and-tab-in-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!