Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is there Directory Chooser in swings?

 
sridhar bvap
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is here, however you can easily to emulate it providing a filter for directories only. Check MediaChest source code for one.
 
Jess Dancel
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic