Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By Tolls

Thread: How To save from JTextArea to a file

  1. #1
    madhav.dubey9 is offline Member
    Join Date
    Jan 2013
    Posts
    25
    Blog Entries
    1
    Rep Power
    0

    Default 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.

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: How To save from JTextArea to a file

    FileWriter is your friend.

  3. #3
    tamilarasi is offline Member
    Join Date
    Nov 2012
    Location
    India
    Posts
    70
    Rep Power
    0

    Default Re: How To save from JTextArea to a file

    have you tried FileWriter in java?

    you refer this links:

    How to write to file in Java – FileOutputStream
    Java - FileWriter Class
    Regards
    Android developer at Trinay Technology Solutions,http://www.trinaytech.com,5705750475

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,002
    Rep Power
    20

    Default Re: How To save from JTextArea to a file

    Quote Originally Posted by tamilarasi View Post
    have you tried FileWriter in java?

    you refer this links:

    How to write to file in Java – FileOutputStream
    Java - FileWriter Class
    Do you actually read the other replies before posting?
    SurfMan likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    tamilarasi is offline Member
    Join Date
    Nov 2012
    Location
    India
    Posts
    70
    Rep Power
    0

    Default Re: How To save from JTextArea to a file

    Quote Originally Posted by Tolls View Post
    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..
    Regards
    Android developer at Trinay Technology Solutions,http://www.trinaytech.com,5705750475

  6. #6
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: How To save from JTextArea to a file

    Quote Originally Posted by tamilarasi View Post
    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...

  7. #7
    tamilarasi is offline Member
    Join Date
    Nov 2012
    Location
    India
    Posts
    70
    Rep Power
    0

    Default Re: How To save from JTextArea to a file

    Quote Originally Posted by SurfMan View Post
    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
    Last edited by tamilarasi; 03-14-2013 at 11:25 AM.
    Regards
    Android developer at Trinay Technology Solutions,http://www.trinaytech.com,5705750475

  8. #8
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    946
    Rep Power
    2

    Default Re: How To save from JTextArea to a file

    Original Poster, in this case madhav.dubey.

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,002
    Rep Power
    20

    Default Re: How To save from JTextArea to a file

    Quote Originally Posted by tamilarasi View Post
    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.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,513
    Blog Entries
    7
    Rep Power
    20

    Default 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
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Java save to file / open from file - trouble
    By joelBeaton in forum Advanced Java
    Replies: 6
    Last Post: 03-23-2012, 12:47 PM
  2. Replies: 3
    Last Post: 06-21-2011, 04:51 PM
  3. save file based on file extension
    By masa in forum AWT / Swing
    Replies: 4
    Last Post: 05-11-2010, 11:17 AM
  4. Replies: 0
    Last Post: 03-05-2010, 04:21 AM
  5. Help with save font information in jtextarea
    By valery in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 08:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •