944,149 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2658
  • Java RSS
May 3rd, 2005
0

how can i implement a string from Jtextfield and saving it to a file

Expand Post »
can someone explain to me how i can go about implementing a string from a jtextfield and storing it to a file please. I would really appreciate some sample code on this one. Thank you
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
SyLk is offline Offline
27 posts
since Oct 2004
May 4th, 2005
0

Re: how can i implement a string from Jtextfield and saving it to a file

Java Syntax (Toggle Plain Text)
  1. try
  2. {
  3. PrintWriter out = new PrintWriter(new FileOutputStream(new File(filename)));
  4. String text = myTextField.getText();
  5. out.print(text);
  6. out.close()
  7. }
  8. catch(Exception e)
  9. {System.out.println(e);}
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Conversion from XML to ResultView
Next Thread in Java Forum Timeline: not finding java.sql package





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC