aspose file tools
The moose likes Swing / AWT / SWT and the fly likes save File with JFileChooser Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "save File with JFileChooser" Watch "save File with JFileChooser" New topic
Author

save File with JFileChooser

nif Tuk
Greenhorn

Joined: Jun 11, 2011
Posts: 2
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
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
"value" is something returned by a JFileChooser; you should not be comparing it to a constant defined in JOptionPane.


Android appsImageJ pluginsJava web charts
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1788
    
    2
(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

Joined: Jun 11, 2011
Posts: 2
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!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: save File with JFileChooser
 
Similar Threads
Is there a getPoints for a Graphics or Graphics2D object
Document Listener and/or Ley Listener
Exception Null
JfileChooser selecting existing file.......?
Weird actionPerformed method.