I’m trying to create TextBox with JavaFX 2.0.
My source is following:
TextBox textBox = new TextBox();
textBox.setPrefSize(150, 600);
textBox.setText("Hello\n world!");
Result is:

How could I create new line in TextBox?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Creating a multilined TextBox is a JavaFX 1.3 feature. In JavaFX 2.0 you have to use a TextArea.
The JavaFX UI Controls tutorial does not mention the TextArea control. Maybe they missed something. As you can see in this JavaFX 1.3 TextBox tutorial the TextBox had a ‘multiline’ and a ‘lines’ property. JavaFX 1.3 did not have a TextArea.