Hi there,
I have a swing application that is using JFileChooser. When I click the Open menu item from File menu it should show the File dialog box where user can select the file.
This application is running in my machine but encounters problem in another machine. File dialog box is not showing and stack trace shows that NullPointerException is thrown by JFileChooser
My machine is a 64 bit Windows 7 while the other machine is Windows 7 32 bit. Both machine are using
java 1.6
To verify if its because of the 32-bit, I tried in another Windows 7 32-bit and the same application is working.
I came across this article
https://bugs.openjdk.java.net/browse/JDK-4711700 which identified it as bug but already fix in 1.4.2_04. Though I am using 1.6, just to make sure I also tried the suggested work around
I put System.setProperty("swing.disableFileChooserSpeedFix", "true"); in my code but still not working
I also tried to add java -Dswing.disableFileChooserSpeedFix=true to the batch file that is launching the application and still not working
Any other suggestions or idea on this? Thanks
Code Sample
Below is the stack trace
ERROR actions.menu.File_Open - Error occured while opening an existing timetable. null
caused by null java.lang.NullPointerException
at javax.swing.ImageIcon.<init><ImageIcon.java:215>
at javax.swing.ImageIcon.<init><ImageIcon.java:201>
at sun.swing.WindowPlaceBar.<init><WindowPlaceBar.java:94>
at com.sun.java.swing.plaf.windows.WindowFileChooserUI.updateUseShellFolder<WindowsFileChooserUI.java:542>
at com.sun.java.swing.plaf.windows.WindowFileChooserUI.installComponents<WindowsFileChooserUI.java:542>
at com.sun.java.swing.plaf.windows.WindowFileChooserUI.installComponents<WindowsFileChooserUI.java:219>
at java.swing.plaf.basic.basicFileChooserUI.installUI<BasicFileChooserUI.java:145>
at com.sun.java.swing.plaf.windows.WindowFileChooserUI.installUI<WindowsFileChooserUI.java:152>
at javax.swing.JComponent.setUI<JComponent.java:681>
at javax.swing.JFileChooser.updateUI<JFileChooser.java:1774>
at javax.swing.JFileChooser.setup<JFileChooser.java:371>
at javax.swing.JFileChooser.<init><JFileChooser.java:344>
at javax.swing.JFileChooser.<init><JFileChooser.java:297>
at actions.menu.File_Open.loadMDBFile<File_Open.java:221>