How To save from JTextArea to a file
If i have several tabs opened each containg JtextArea with some contents.I need to save the contents of a particular tab's JTextArea to a particular file.
How i can do that.Please help.
Re: How To save from JTextArea to a file
FileWriter is your friend.
Re: How To save from JTextArea to a file
Re: How To save from JTextArea to a file
Quote:
Originally Posted by
tamilarasi
Do you actually read the other replies before posting?
Re: How To save from JTextArea to a file
Quote:
Originally Posted by
Tolls
Do you actually read the other replies before posting?
yes i read the other replies before posting. But you already told don't post the code. you only give the suggestion. I gave only suggestion.
And also i gave two options for write content in the file..
Re: How To save from JTextArea to a file
Quote:
Originally Posted by
tamilarasi
yes i read the other replies before posting. But you already told don't post the code. you only give the suggestion. I gave only suggestion.
And also i gave two options for write content in the file..
Your additions are welcome. The OP will find it very helpful. However, if the OP has trouble googling for a FileWriter example, he might be better off finding a job other than programming...
Re: How To save from JTextArea to a file
Quote:
Originally Posted by
SurfMan
Your additions are welcome. The OP will find it very helpful. However, if the OP has trouble googling for a FileWriter example, he might be better off finding a job other than programming...
What is OP ? i couldn't get you clearly
Re: How To save from JTextArea to a file
Original Poster, in this case madhav.dubey.
Re: How To save from JTextArea to a file
Quote:
Originally Posted by
tamilarasi
yes i read the other replies before posting. But you already told don't post the code. you only give the suggestion. I gave only suggestion.
And also i gave two options for write content in the file..
But SurfMan had already given a link to the API...nearly a week ago.
If they still had a problem, or the information was not enough, then just wait for them to get back.
Re: How To save from JTextArea to a file
The JTextArea class extends the JTextComponent class; the latter implements a public method that can save its text contents to a Writer; read the API documentation.
kind regards,
Jos