Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTextArea and Carriage Return

843806Jul 8 2009 — edited Jul 8 2009
When I try to save a text area that has multiple lines with FileWriter and open the file with Notepad, it is all printed on one line. It seems that the text area's string is formatted as "First Line/nNext Line". But it would only look right in Notepad if it used carriage return for new lines like "First Line/n/rNext Line". Is there any way to have JTextArea automatically include /r for new lines or do I have to format it myself by adding a /r after every /n?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2009
Added on Jul 8 2009
2 comments
331 views