JDK-6691718 : NIMBUS: NPE thrown when using Nimbus in this photo uploader
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-04-21
  • Updated: 2011-02-16
  • Resolved: 2008-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b26Fixed
Related Reports
Relates :  
Description
After setting Nimbus as the default look and feel through swing.properties, the photo uploader in this site does not load. Java console shows NPE is thrown:

java.lang.NullPointerException
    at javax.swing.JSplitPane.setUIProperty(Unknown Source)
    at javax.swing.LookAndFeel.installProperty(Unknown Source)
    at javax.swing.plaf.basic.BasicSplitPaneUI.installDefaults(Unknown Source)
    at javax.swing.plaf.basic.BasicSplitPaneUI.installUI(Unknown Source)
    at javax.swing.JComponent.setUI(Unknown Source)
    at javax.swing.JSplitPane.setUI(Unknown Source)
    at com.fotki.panels.FileSystemPanel.setUpUI(FileSystemPanel.java:214)
    at com.fotki.panels.FileSystemPanel.<init>(FileSystemPanel.java:201)
    at com.fotki.base.BrowseScreen.<init>(BrowseScreen.java:71)
    at com.fotki.applet.FotkiUploader4.init(FotkiUploader4.java:239)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

To reproduce:
0. Set Nimbus as the default LAF
1. go to http://fotki.com
2. create an album
3. use the Java Photo Uploader
4. NPE thrown.

Environment: Vista, IE 7, FF 2 or 3, 6u10-b22 and nitely build (see comment).

Comments
SUGGESTED FIX Add "d.put("SplitPane.dividerSize", new Integer(10));" into NimbusDefaults so that does not though a NPE if BasicSplitPaneUI is used in the context of Nimbus LAF. *** (#1 of 1): [ UNSAVED ] ###@###.###
21-05-2008

EVALUATION When using Nimbus LAF we must support the use of BasicUI classes for single components when the main UI is using Nimbus LAF. We have seen many cases like this where UIManager keys that are required by basic are not set by default by Nimbus and cause Basic to throw NPE errors. In this case they are using BasicSplitPaneUI which is expecting a value to be stored in UIManager for "SplitPane.dividerSize" and we are not setting this in Nimbus as we don't need it. So we need to add this key and a sensable value for it to UIManager. Also it looks like the UI is being built in a thread that is not the EDT which may cause other issues in the applet. *** (#1 of 1): [ UNSAVED ] ###@###.###
21-05-2008