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()));
Matt Humphrey - 13 Apr 2008 16:26 GMT
> 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()));
Yes, but what are you using to open the dialog? showOpenDialog or
showSaveDialog?
Matt Humphrey http://www.iviz.com/
Alex.From.Ohio.Java@gmail.com - 13 Apr 2008 17:28 GMT
On Apr 13, 10:58 am, Chase Preuninger <chasepreunin...@gmail.com>
wrote:
> 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/
Roedy Green - 14 Apr 2008 04:14 GMT
On Sun, 13 Apr 2008 07:58:04 -0700 (PDT), Chase Preuninger
<chasepreuninger@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>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 http://mindprod.com/jgloss/jfilechooser.html
for sample code.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com