JDK-6612715 : Nimbus LAF: NPE in jconsole when Nimbus is used as default LaF
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-10-03
  • Updated: 2011-02-16
  • Resolved: 2007-12-07
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_05-ea"
Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b04)
Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b04, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Linux 2.6.20-16-generic #2 SMP i686 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
When jconsole is fired up with Nimbus as default Look and Feel, then an NPE occurs. The connection window (which is normally apperaing now) does not show. More NPE's if one clicks on Connection -> New Connection... in the main menu.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Launch jconsole from 1.6.0_05-ea with Nimbus as default LaF:

jconsole -J-Dswing.defaultlaf=sun.swing.plaf.nimbus.NimbusLookAndFeel

You'll receive an NPE in sun.tools.jconsole.Utilities.getColorBrightness:133



ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at sun.tools.jconsole.Utilities.getColorBrightness(Utilities.java:131)
        at sun.tools.jconsole.Utilities.ensureContrast(Utilities.java:115)
        at sun.tools.jconsole.ConnectDialog.revalidate(ConnectDialog.java:260)
        at javax.swing.JComponent.setVisible(JComponent.java:2619)
        at sun.tools.jconsole.ConnectDialog.setVisible(ConnectDialog.java:544)
        at javax.swing.JInternalFrame.<init>(JInternalFrame.java:335)
        at sun.tools.jconsole.InternalDialog.<init>(InternalDialog.java:26)
        at sun.tools.jconsole.ConnectDialog.<init>(ConnectDialog.java:64)
        at sun.tools.jconsole.JConsole.showConnectDialog(JConsole.java:602)
        at sun.tools.jconsole.JConsole.access$800(JConsole.java:36)
        at sun.tools.jconsole.JConsole$6.run(JConsole.java:815)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)





REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION Missing UiDefaults keys is a common issue and solved in bug 6612359.
07-12-2007

EVALUATION JConsole is using these UI defaults colors, without checking for null values: Label.disabledForeground Panel.background Table.background
14-11-2007