United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6691718 NIMBUS: NPE thrown when using Nimbus in this photo uploader
JDK-6691718 : NIMBUS: NPE thrown when using Nimbus in this photo uploader

Details
Type:
Bug
Submit Date:
2008-04-21
Status:
Closed
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2008-06-09
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10 (b26)

Related Reports
Relates:

Sub Tasks

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 ] ###@###.###
                                     
2008-05-21
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 ] ###@###.###
                                     
2008-05-21



Hardware and Software, Engineered to Work Together