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
posted
0
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
posted
0
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
posted
0
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.