Results 1 to 5 of 5
- 01-27-2013, 10:13 PM #1
Member
- Join Date
- Nov 2012
- Posts
- 57
- Rep Power
- 0
Write to external file from textfield
I need to get user input from a Jtextfield, store it in a variable, and then write it to an external file.
I have tried FileWriter fw = new FileWriter();, and fw.write();, but I cannot find a way to use a variable in fw.write(need to put variable here)??.gif)
PLEASE HELP!!
-
Re: Write to external file from textfield
No don't call the write(...) method of FileWriter as that is way too low-level. Instead you need to wrap your FileWriter in another more friendly Writer such as a PrintWriter. Then you could simply call print(...) or println(...) passing in the String you wish to output.
- 01-28-2013, 12:41 AM #3
Member
- Join Date
- Nov 2012
- Posts
- 57
- Rep Power
- 0
Re: Write to external file from textfield
Thank you, I will try it that way!!
-
Re: Write to external file from textfield
Great and good luck. Please let us know how it turns out!
- 01-28-2013, 07:25 AM #5
Member
- Join Date
- Nov 2012
- Posts
- 57
- Rep Power
- 0
Similar Threads
-
how to pass value from textfield to object or file(serializable file)
By couline in forum New To JavaReplies: 5Last Post: 03-10-2012, 04:46 PM -
Open external file with external program
By Wietse de Vries in forum New To JavaReplies: 1Last Post: 12-31-2011, 04:52 PM -
Make the TextField unable to write on
By Josep_16 in forum Java AppletsReplies: 4Last Post: 08-21-2011, 08:06 AM -
How to write a code for defining a maxlenght for a textfield ?!
By qwerty53 in forum New To JavaReplies: 3Last Post: 07-06-2011, 12:50 PM -
called external program does not automatically write file
By nickvandewiele in forum New To JavaReplies: 6Last Post: 02-25-2010, 02:38 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks