The moose likes Swing / AWT / SWT / JFace and the fly likes JFileChooser list of roots/directories Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JFileChooser list of roots/directories" Watch "JFileChooser list of roots/directories" New topic
Author

JFileChooser list of roots/directories

Stan Sharpe
Greenhorn

Joined: Mar 22, 2001
Posts: 2
How does one control the list of roots/directires in the pulldown at the top of the JFileChooser ?
I want to limit the user to a specific list of directories.
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
Have you tried using a FileFilter? I know that will work for the directories in the chooser, maybe it will also apply to the directories in the drop-down box.
Stan Sharpe
Greenhorn

Joined: Mar 22, 2001
Posts: 2
I've tried the FileFilter but that appears to only apply to what is in the "file" box. I couldn't find anything related to "list of directories" that would fill in the pulldown.
Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
I am sure I am horribly late, but the answer is: setFileSystemView(); you have to write your own FileSystemView, getRoots() of which returns the drives you want to return.


Thanks,<br />Vlad
 
 
subject: JFileChooser list of roots/directories
 
Threads others viewed
Simple file browser !!!!!!
File browser crash course
Is there any Browse button control in Swing ??
how to write coding for browse button in java swing?
Layout assistance please
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture