• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not Recognizing the new line

 
Kumar Navin
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
I have made a GUI which has a TextArea. Am trying to write the contents of the TextArea into a file using FileOutputStream. It is writing but every new line entry is replaced by a rectangular like structure and is not writing to a new line.
Could you please explain and help me out of this.

Thanks.

-Navin.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Windows uses two characters, a carrage return and a line feed, to indicate a line. You should use BufferedWriter to write your file, as it is text (Streams are used for binary data) and that class provides a handy newLine() method to relieve you from the responsability of keeping track of which platform recognizes which line format.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!