United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6616742 Nimbus L&F: java.lang.NullPointer Exception arised when trying to display unsigned applet
JDK-6616742 : Nimbus L&F: java.lang.NullPointer Exception arised when trying to display unsigned applet

Details
Type:
Bug
Submit Date:
2007-10-15
Status:
Closed
Updated Date:
2011-02-24
Project Name:
JDK
Resolved Date:
2008-01-08
Component:
client-libs
OS:
windows_vista,windows_xp
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u5
Fixed Versions:
6u10 (b10)

Related Reports
Duplicate:

Sub Tasks

Description
java.lang.NullPointerException arised when trying to display unsigned applet through browser & the exception arised due to nimbus being sun.swing.  The bug can be reproduced both in IE(7) aswell as in mozilla 2.0.07. 

I set -Dswing.defaultlaf=sun.swing.plaf.nimbus.NimbusLookAndFeel in java option in java control pane & tried display swingset2.

Step to reproduced:
----------------------
1) Install 6u5_04 or any nimbus supported jdk & jre promotoed build.
2) Set the jre option in java control panel (-Dswing.defaultlaf=sun.swing.plaf.nimbus.NimbusLookAndFeel) &  java console.
3) Try launching SwingSet2.html , you will see exception on java console.


Exception 
---------
Exception in thread "Thread-5" java.lang.NullPointerException
	at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
	at javax.swing.UIDefaults.getUI(Unknown Source)
	at javax.swing.UIManager.getUI(Unknown Source)
	at javax.swing.JPanel.updateUI(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at sun.plugin.util.ErrorPanel.<init>(Unknown Source)
	at sun.plugin.util.GrayBoxPanel.setError(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.getGrayBoxPanel(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
	at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-SwingSet2Applet" java.lang.NullPointerException
	at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
	at javax.swing.UIDefaults.getUI(Unknown Source)
	at javax.swing.UIManager.getUI(Unknown Source)
	at javax.swing.JPanel.updateUI(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at sun.plugin.util.ErrorPanel.<init>(Unknown Source)
	at sun.plugin.util.GrayBoxPanel.setError(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
	at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-4" java.lang.NullPointerException
	at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
	at javax.swing.UIDefaults.getUI(Unknown Source)
	at javax.swing.UIManager.getUI(Unknown Source)
	at javax.swing.JPanel.updateUI(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at javax.swing.JPanel.<init>(Unknown Source)
	at sun.plugin.util.ErrorPanel.<init>(Unknown Source)
	at sun.plugin.util.GrayBoxPanel.setError(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.access$200(Unknown Source)
	at sun.plugin.util.GrayBoxPainter$1.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

                                    

Comments
EVALUATION

We need to move nimbus from sun.swing.plaf.nimbus to com.sun.swing.plaf.nimbus this will resolve problems accessing sun.swing package from unsigned applets.
                                     
2007-12-10
EVALUATION

The correct new package is "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel" not "com.sun.swing...".
                                     
2008-01-07



Hardware and Software, Engineered to Work Together