Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> Java Beginner

Pages: 1
umaj
member


Reged: 07/27/06
Posts: 141
Loc: Bahawalpur (pakistan)
problem in file save Dialog box
      #41475 - 12/09/06 10:51 AM

i have a problem in file saveDialog box
i not want to give file name when save dialog box appear which ask me to enter the file name after selecting the Location..

because i receive any type(.mp3,.txt,.doc)file in my class i want that when i click on a button which show me the file save Dialog box in which i select the location of file to save but at that time i not again given the file name and without it filesave dialog box not close

so any solution of that problem i only want the Path which user selected to save file but without given the file name


Post Extras: Print Post   Remind Me!   Notify Moderator  
Prachi
stranger


Reged: 07/27/08
Posts: 3
Loc: California
Re: problem in file save Dialog box [Re: umaj]
      #176483 - 07/27/08 08:29 PM

Hi,

I think what you need to use here is the directory chooser dialog instead of the save file dialog.
If all you need to do is choose a location, then you should use the following code:

Code:
 
//Create a file chooser
final JFileChooser fc = new JFileChooser();
//Set the file chooser to allow only directory selection
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);



Hope this helps,
Prachi

--------------------
Software Engineer


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 6668

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5