Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java IO stream line break problem

 
ImpulsEa Jany
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the code that i use to write text in a text file in java.

the text variable is the JTextArea



the input is form a JTextArea reading the content of the JTextArea by line and writing it by line in a text file.

example: the text area contains
hello world
lets rock

when you open the text in notepad the output is still the same.
hello world
lets rock


but when i open the file in the text area in the program that i made the output becomes like this.
hello world

lets rock


a new line is added between the two lines of text.

here is the code for displaying the text in from the text file to the text area



the holdcont holds the content that will be displayed in the text area.
If i delete the new line code "\n" the output will be like this

hello worldlets rock

i want the output to be like this
hello world
lets rock

when i open the text file to the text area

someone please help me on finding another way on puting a new line on a text file PLEASE
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic