JTextArea and Carriage Return
843806Jul 8 2009 — edited Jul 8 2009When 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?