new line in java
Java newbie here, I'm having trouble setting a new line in this code:
String FnameTextboxText = FnameTextbox.getText();
String LastnameTextboxText = LastnameTextbox.getText();
String CourseTextboxText = CourseTextbox.getText();
Summary.setText("Firstname:" + " " + FnameTextboxText + "\nLastname:" + " " + LastnameTextboxText + "\nCourse:" + " " + CourseTextboxText);
Also tried something like: "\n" + "Lastname"
But its no good.
Do you have any idea on how to make new lines. So that it'll look like this;
Firstname: x
Lastname: y 开发者_开发百科
Course: Z
Using netbeans 6.8. On windows.
I guess you need to use TextArea.
First, use TextArea Second, test using \r or \n or \r\n Sometimes, people use \n to make new line and sometimes, like me, use \r\n to make new line
精彩评论