JFileChooser

C

Chase Preuninger

for some reason when I open this dialog the button still says "Open"

chooser.setDialogType(JFileChooser.SAVE_DIALOG);
chooser.setMultiSelectionEnabled(false);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setSelectedFile(new File(f.getName()));
 
A

Alex.From.Ohio.Java

for some reason when I open this dialog the button still says "Open"

chooser.setDialogType(JFileChooser.SAVE_DIALOG);
chooser.setMultiSelectionEnabled(false);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setSelectedFile(new File(f.getName()));

See examples here:

http://exampledepot.com/egs/javax.swing.filechooser/pkg.html

And, BTW, use this site for short, quick and precise examples of any
kind of Java sniplets:

http://exampledepot.com/
I use it for years since it was http://javaalmanac.com

Alex.
http://www.myjavaserver.com/~alexfromohio/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top