Jbutton write to file when clicked
Author |
Message |
hamid14
![](http://compsci.ca/v3/uploads/user_avatars/12047066924bcf67a12efdb.png)
|
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? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
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. |
|
|
|
|
![](images/spacer.gif) |
hamid14
![](http://compsci.ca/v3/uploads/user_avatars/12047066924bcf67a12efdb.png)
|
Posted: Wed Jun 08, 2011 11:24 am Post subject: Re: Jbutton write to file when clicked |
|
|
That was it, thanks. |
|
|
|
|
![](images/spacer.gif) |
|
|