Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

save File with JFileChooser  RSS feed

 
nif Tuk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I'm new here due to ... well, honestly, desperation lol
I've search Google clean and still can't figure out what I'm doing wrong.
I've got a GUI that allows users to write text into the notes are and then a JMenu that allows the user to save what is in the notes text area (or am trying).
I want JFileChooser to save the file.... but it never actually saves. I understand that you need to "save it yourself" after getting JFileChooser to get the path/location or whatever, but somehow its just not clicking in my head!


(This is but one of the hundreds of attempts I've tried....)
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"value" is something returned by a JFileChooser; you should not be comparing it to a constant defined in JOptionPane.
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(This is but one of the hundreds of attempts I've tried....)


The basic problem solving technique is to "step through the code" using a debugger to double check the logic flow.

If you don't have a debugger, then you need to add System.out.println(...) statements to check the flow and check all the values of your variables.

You can't just guess what might be wrong.
 
nif Tuk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:
(This is but one of the hundreds of attempts I've tried....)


The basic problem solving technique is to "step through the code" using a debugger to double check the logic flow.

If you don't have a debugger, then you need to add System.out.println(...) statements to check the flow and check all the values of your variables.

You can't just guess what might be wrong.


I know.... after 15 hours at it yesterday I started messing up even more so I think I made even more of a mess of it. I finally figured it out... by simplifying it (the one thing I didn't do!) Go figure, I sign up and post a question and find the answer lol
Thank you guys for helping!
After I hand in my senior project and it gets graded I'll post what worked!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!