JFileChooser Could not get shell folder ID list
843806Dec 21 2008 — edited Dec 23 2008I am getting the following error when trying to use a JFileChooser.
java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list
at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)
at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.getRecent(Unknown Source)
at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
at sun.awt.shell.ShellFolder.get(Unknown Source)
at sun.swing.WindowsPlacesBar.<init>(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.updateUseShellFolder(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(Unknown Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JFileChooser.updateUI(Unknown Source)
at javax.swing.JFileChooser.setup(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
Googling, I see references to this thread: http://forums.sun.com/thread.jspa?messageID=10553540
(and others) that refer to problems in the windows registry.
I have tried this but all of my registry keys point to valid drives
Is there any way to determine which key the JFileChooser is croaking on?
It seems that this is a quite well known issue, and there is a "workaround" by changing the registry, but this is not really an acceptable solution.
I am distributing java software that is blowing up because of this JFileChooser limitation, so I dont want to have to ask users to hack their registry to make my app work.
Can anyone think of a way to trap this error and recover from it gracefully?