Attila Toth
Attila Toth

Reputation: 307

JavaFX how to write text to a new line in a textArea?

I use this: TextA.appendText(String) Is there a way to put the text to the next line?

Upvotes: 3

Views: 26118

Answers (2)

Casey Bowden
Casey Bowden

Reputation: 11

TextA.appendText("\n")

Will add a new line.

Upvotes: 1

eckig
eckig

Reputation: 11154

String newLine = System.getProperty("line.separator");

Or if you want to have it a bit more direct:

String newLine = "\n";

Append or prepend the new line to your TextArea to create new lines.

Upvotes: 8

Related Questions