Duplicate :
|
FULL PRODUCT VERSION : JDK 6_20 ADDITIONAL OS VERSION INFORMATION : Windows XP Latest Service Pack EXTRA RELEVANT SYSTEM CONFIGURATION : Running in Net beans 2.8 A DESCRIPTION OF THE PROBLEM : This snip-it of code will generate within 13 tries the following error. private void File1CMSActionPerformed(java.awt.event.ActionEvent evt) { int result; File Inputfile; boolean GoodFile = false; JFileChooser fcFC1 = new JFileChooser(); FileSystemView view = fcFC1.getFileSystemView(); fcFC1.setDialogTitle("CMS File Open"); fcFC1.setCurrentDirectory(view.getDefaultDirectory()); fcFC1.setFileSelectionMode(JFileChooser.FILES_ONLY); result = fcFC1.showOpenDialog(this); run: Exception in thread "Basic L&F File Loading Thread" java.lang.NullPointerException at sun.awt.shell.Win32ShellFolder2.pidlsEqual(Win32ShellFolder2.java:498) at sun.awt.shell.Win32ShellFolder2.equals(Win32ShellFolder2.java:491) at sun.awt.shell.Win32ShellFolderManager2.isFileSystemRoot(Win32ShellFolderManager2.java:350) at sun.awt.shell.ShellFolder.isFileSystemRoot(ShellFolder.java:242) at javax.swing.filechooser.FileSystemView.isFileSystemRoot(FileSystemView.java:323) at javax.swing.filechooser.WindowsFileSystemView.isTraversable(FileSystemView.java:657) at javax.swing.JFileChooser.isTraversable(JFileChooser.java:1561) at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:232) at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:211) If can not be caught. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : place the snip-it in a standard java package in Netbeans 6.8. Call from a menu item. Will occur within 13 tries. Dialog box still shows up. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - No error just the dialog box showing up. ACTUAL - as described. ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "Basic L&F File Loading Thread" java.lang.NullPointerException at sun.awt.shell.Win32ShellFolder2.pidlsEqual(Win32ShellFolder2.java:498) at sun.awt.shell.Win32ShellFolder2.equals(Win32ShellFolder2.java:491) at sun.awt.shell.Win32ShellFolderManager2.isFileSystemRoot(Win32ShellFolderManager2.java:350) at sun.awt.shell.ShellFolder.isFileSystemRoot(ShellFolder.java:242) at javax.swing.filechooser.FileSystemView.isFileSystemRoot(FileSystemView.java:323) at javax.swing.filechooser.WindowsFileSystemView.isTraversable(FileSystemView.java:657) at javax.swing.JFileChooser.isTraversable(JFileChooser.java:1561) at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:232) at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:211) REPRODUCIBILITY : This bug can be reproduced often. ---------- BEGIN SOURCE ---------- private void File1CMSActionPerformed(java.awt.event.ActionEvent evt) { int result; File Inputfile; boolean GoodFile = false; JFileChooser fcFC1 = new JFileChooser(); FileSystemView view = fcFC1.getFileSystemView(); fcFC1.setDialogTitle("CMS File Open"); fcFC1.setCurrentDirectory(view.getDefaultDirectory()); fcFC1.setFileSelectionMode(JFileChooser.FILES_ONLY); result = fcFC1.showOpenDialog(this); } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Just ignore. But I do not know what else it is saying or covering up.