• Post Reply Bookmark Topic Watch Topic
  • New Topic

line break JTextArea  RSS feed

 
Tai Yo
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I inputted these data to JTextArea:

But output in test.txt file I am getting result in one line:
How can I get text as inputted, i.e. if data with 3 column, then output with 3 column, same for 4, 5, ... column data?

 
Tai Yo
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the trouble, I have solved my problem.
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your solution in case others have the same problem and wonder how you solved it?
 
Mohsen Salahshoor
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the println method of PrintWriter, and also don't forget to call the PrintWriter's flush method.

Edit: Sorry I didn't see your post saying you've solved the problem.
 
Tai Yo
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Norm Radder: as solution I have used the answer from following link:
http://stackoverflow.com/questions/15483350/jtextarea-txt-txt-gettext-skips-n
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!