The error occuring is that jFileChooser is not able to read some of the
system files such as files in the recycle bin, pagefile.sys, hiberfil.sys
....
these files are listed through the File object ...
However, the jFileChooser cannot find these system file icons because it
cannot find the hidden system file....
I want to check if jFileChooser can find the file before I call the getIcon
or getDescription functions....
It throws an exception internally that I cannot catch either...
I have disabled jFileChooser file hiding...
How can I fix this bug.
Thanks,
- DooL
Below is the Exception if needed
----------------
FileSystemView.getShellFolder: f=D:\hiberfil.sys
java.io.FileNotFoundException
at sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:188)
at
javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:46
3)
at
javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:183
)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon
(WindowsFileChooserUI.java:2058)
at javax.swing.JFileChooser.getIcon(JFileChooser.java:1499)
at
TableRenderer.getTableCellRendererComponent(TableRenderer.java:27)
at javax.swing.JTable.prepareRenderer(JTable.java:3669)
at
javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1100)
at
javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1022)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:963)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:145)
at javax.swing.JComponent.paintComponent(JComponent.java:531)
at javax.swing.JComponent.paint(JComponent.java:798)
at javax.swing.JComponent.paintChildren(JComponent.java:637)
at javax.swing.JComponent.paint(JComponent.java:807)
at javax.swing.JViewport.paint(JViewport.java:704)
at javax.swing.JComponent.paintChildren(JComponent.java:637)
at javax.swing.JComponent.paint(JComponent.java:807)
at
javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4744)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4697)
at javax.swing.JComponent._paintImmediately(JComponent.java:4641)
at javax.swing.JComponent.paintImmediately(JComponent.java:4473)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:407)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQu
eueUtilities.java:120)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:176)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:446)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:193)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:147)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
java.lang.NullPointerException
at
javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:184
)
at
com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon
(WindowsFileChooserUI.java:2058)
at javax.swing.JFileChooser.getIcon(JFileChooser.java:1499)
at
TableRenderer.getTableCellRendererComponent(TableRenderer.java:27)
at javax.swing.JTable.prepareRenderer(JTable.java:3669)
at
javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1100)
at
javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1022)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:963)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:145)
at javax.swing.JComponent.paintComponent(JComponent.java:531)
at javax.swing.JComponent.paint(JComponent.java:798)
at javax.swing.JComponent.paintChildren(JComponent.java:637)
at javax.swing.JComponent.paint(JComponent.java:807)
at javax.swing.JViewport.paint(JViewport.java:704)
at javax.swing.JComponent.paintChildren(JComponent.java:637)
at javax.swing.JComponent.paint(JComponent.java:807)
at
javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4744)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4697)
at javax.swing.JComponent._paintImmediately(JComponent.java:4641)
at javax.swing.JComponent.paintImmediately(JComponent.java:4473)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:407)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQu
eueUtilities.java:120)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:176)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:446)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:193)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:147)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:141)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:133)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:101)
----------------