It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes JFileChooser to save file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser to save file" Watch "JFileChooser to save file" New topic

JFileChooser to save file

Danny Paul

Joined: Sep 22, 2004
Posts: 1

i m new to java, i m trying to learn the GUI swing.

can anyone tell me how to save a file using JFileChooser.
i know a method jf.showSaveDialog(null). but how to use this method to save a file.

Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
Once you show the dialog, the user selects a file and then presses the APPROVE_BUTTON. After that it is up to you to physically save the file.

chris forbes

Joined: Mar 05, 2010
Posts: 1
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46352
Welcome to the Ranch
I agree. Here's the link:
subject: JFileChooser to save file
It's not a secret anymore!