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)?? :(think):
PLEASE HELP!! :(nod):
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.
Re: Write to external file from textfield
Thank you, I will try it that way!! :beer:
Re: Write to external file from textfield
Great and good luck. Please let us know how it turns out!
Re: Write to external file from textfield
I will, as soon as I can get that to work for me!! :(think):