File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes is there Directory Chooser in swings? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "is there Directory Chooser in swings?" Watch "is there Directory Chooser in swings?" New topic

is there Directory Chooser in swings?

sridhar bvap

Joined: Mar 12, 2008
Posts: 19
I want to select the path or location where to the file has to save.
I tried using JFileChooser, but it is not comming. It allows only to select a file, but i don't want to select a file. I have already file, i want to aloow user to select the location where to save the file, by some promt window just like File Chooser.
If any budy knows Please help me.

thanks to one and all.
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

I think it is here, however you can easily to emulate it providing a filter for directories only. Check MediaChest source code for one.

Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
Jess Dancel

Joined: Nov 07, 2007
Posts: 11
I may misunderstand what you're asking, but my JFileChoosers also allow me to choose the file location. I get all the folder options at the top of the window. I am running Linux--don't know if Windows would display it differently.
[ April 04, 2008: Message edited by: Jess Dancel ]
Rob Spoor

Joined: Oct 27, 2005
Posts: 20276

JFileChooser has a method called setFileSelectionMode, which can take three values:
- JFileChooser.FILES_ONLY

Call it with the second one, use a correct javax.swing.filechooser.FileFilter and you're set to go.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: is there Directory Chooser in swings?
It's not a secret anymore!