aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFileChooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFileChooser" Watch "JFileChooser" New topic
Author

JFileChooser

Jude Fawly
Ranch Hand

Joined: Dec 01, 2004
Posts: 33
hi,

how can i limit the jfilechooser to search only in a specific folder nothing more?

thanks.


Teach me to die that so I may<br />Rise glorious at the awful day
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
you can hide/disable the navigation buttons and the combobox, but subfolders
will show.

might be easier to use a JList populated with listFiles() filtered by isFile()
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

Have you tried providing it with a FileFilter that only accepts files (not subdirectories) in that directory?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Hi Doc,

yep, that works - didn't even cross my mind (a short trip!)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFileChooser