wood burning stoves 2.0*
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
Author

is there Directory Chooser in swings?

sridhar bvap
Greenhorn

Joined: Mar 12, 2008
Posts: 19
Hi,
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
Greenhorn

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
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

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

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is there Directory Chooser in swings?
 
Similar Threads
Download pdf file in struts2
JFileChooser modification
Database connection
JList selection
JFileChooser customizing