View Single Post
Old 02-02-2007, 02:22 PM   #4
Bert
Enthusiast
Bert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with othersBert plays well with others
 
Posts: 43
Karma: 2898
Join Date: Jan 2007
Location: Belgium
Device: iRex iLiad, PRS-600
That's a strange problem ... Are you sure that directory contains any directories?

The 'open file' dialog does absolutely no filtering (except that it only accepts directories), I was planning to filter on irex-pdf dirs directly with the file-chooser, but I couldn't find a way to do it. Eventually I just decided to accept all directories, and check if they are valid later on.

Let me show you the code which shows the dialog, so you can see why this is so strange:
Code:
...
        //show the file chooser
        JFileChooser fc = new JFileChooser();
        fc.setAcceptAllFileFilterUsed(false);
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        fc.setSelectedFile(fileInput);
        FileFilter ff = new FileFilter() {
            public boolean accept(File f) {
                return f.isDirectory();
            }
            
            public String getDescription() {
                return "iRex pdf directories";
            }
        };
        fc.setFileFilter(ff);
        int nReturnValue = fc.showOpenDialog(this);
...
You can see the "iRex pdf directories" file filter is superfluous, it does the same as the JFileChooser.DIRECTORIES_ONLY selection mode.

BTW: I developed this app on Windows XP SP2, with jdk1.5.0_09, and using JRE 1.5.0_09-b03. So I see no problems there.


A temporary solution: If you can't get it to work, you could always just type the complete path in the 'source' box manually, that should work also.
Bert is offline   Reply With Quote