Jbutton write to file when clicked
Author |
Message |
hamid14

|
Posted: Wed Jun 08, 2011 10:54 am Post subject: Jbutton write to file when clicked |
|
|
I have a JButton that when you click it, it's supposed to write to a file named "in.txt". The problem is that when you click the button, it doesn't write to file. I have another JButton that reads in text from a text file and prints it out when you click the button, that one works. Why isn't the 1st jbutton writing to file? |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
DemonWasp
|
Posted: Wed Jun 08, 2011 10:59 am Post subject: RE:Jbutton write to file when clicked |
|
|
At a complete guess, since you forgot to post your code, you forgot to .close() the output stream. |
|
|
|
|
 |
hamid14

|
Posted: Wed Jun 08, 2011 11:24 am Post subject: Re: Jbutton write to file when clicked |
|
|
That was it, thanks. |
|
|
|
|
 |
|
|