Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2008

Tip: Looking for answers? Try searching our database.

JFileChooser

Thread view: 
Chase Preuninger - 13 Apr 2008 15:58 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()));
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.