Details
-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b16
-
generic
-
generic
Description
SYNOPSIS
--------
SwingSet2 throws NullPointerException with Nimbus L&F
OPERATING SYSTEMS
-----------------
All (tested on Windows and Linux)
FULL JDK VERSION
----------------
All releases that include the Nimbus L&F (~6u10 onwards)
DESCRIPTION
-----------
The SwingSet2 demo throws a NullPointerException under certain circumstances with the Nimbus L&F. It isn't immediately clear whether the bug is in the demo code or the class library.
STEPS TO REPRODUCE
------------------
1. Run SwingSet2 demo with the Nimbus L&F:
> java -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -jar <path to JDK>\demo\jfc\SwingSet2\SwingSet2.jar
3. Drag the icon tool bar (which is floatable) out of the GUI Window
4. Once the tool bar is detached, click on "Look & Feel" menu option, and select either "Motif Look & Feel" or "Windows Style / GTK Look & Feel" (depends on platform)
5. Observe the NullPointerException on the console (the example below is from 1.7.0_05-b02 on Windows):
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at sun.font.FontDesignMetrics$MetricsKey.init(FontDesignMetrics.java:217)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:286)
at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1012)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1624)
at javax.swing.plaf.synth.SynthTabbedPaneUI.getFontMetrics(SynthTabbedPaneUI.java:834)
at javax.swing.plaf.synth.SynthTabbedPaneUI.getFontMetrics(SynthTabbedPaneUI.java:830)
at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateTabRects(BasicTabbedPaneUI.java:2547)
at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateLayoutInfo(BasicTabbedPaneUI.java:2510)
at javax.swing.plaf.synth.SynthTabbedPaneUI$2.calculateLayoutInfo(SynthTabbedPaneUI.java:883)
at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.layoutContainer(BasicTabbedPaneUI.java:2405)
at java.awt.Container.layout(Container.java:1503)
at java.awt.Container.doLayout(Container.java:1492)
at java.awt.Container.validateTree(Container.java:1688)
at java.awt.Container.validate(Container.java:1623)
at javax.swing.plaf.synth.SynthTabbedPaneUI.ensureCurrentLayout(SynthTabbedPaneUI.java:740)
at javax.swing.plaf.synth.SynthTabbedPaneUI.paint(SynthTabbedPaneUI.java:443)
at javax.swing.plaf.synth.SynthTabbedPaneUI.update(SynthTabbedPaneUI.java:378)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1482)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1413)
at javax.swing.RepaintManager.paint(RepaintManager.java:1206)
at javax.swing.JComponent._paintImmediately(JComponent.java:5169)
at javax.swing.JComponent.paintImmediately(JComponent.java:4980)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:770)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:728)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:677)
at javax.swing.RepaintManager.access$700(RepaintManager.java:59)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1621)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:701)
at java.awt.EventQueue.access$000(EventQueue.java:102)
at java.awt.EventQueue$3.run(EventQueue.java:662)
at java.awt.EventQueue$3.run(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:671)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
--------
SwingSet2 throws NullPointerException with Nimbus L&F
OPERATING SYSTEMS
-----------------
All (tested on Windows and Linux)
FULL JDK VERSION
----------------
All releases that include the Nimbus L&F (~6u10 onwards)
DESCRIPTION
-----------
The SwingSet2 demo throws a NullPointerException under certain circumstances with the Nimbus L&F. It isn't immediately clear whether the bug is in the demo code or the class library.
STEPS TO REPRODUCE
------------------
1. Run SwingSet2 demo with the Nimbus L&F:
> java -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -jar <path to JDK>\demo\jfc\SwingSet2\SwingSet2.jar
3. Drag the icon tool bar (which is floatable) out of the GUI Window
4. Once the tool bar is detached, click on "Look & Feel" menu option, and select either "Motif Look & Feel" or "Windows Style / GTK Look & Feel" (depends on platform)
5. Observe the NullPointerException on the console (the example below is from 1.7.0_05-b02 on Windows):
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at sun.font.FontDesignMetrics$MetricsKey.init(FontDesignMetrics.java:217)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:286)
at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1012)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1624)
at javax.swing.plaf.synth.SynthTabbedPaneUI.getFontMetrics(SynthTabbedPaneUI.java:834)
at javax.swing.plaf.synth.SynthTabbedPaneUI.getFontMetrics(SynthTabbedPaneUI.java:830)
at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateTabRects(BasicTabbedPaneUI.java:2547)
at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateLayoutInfo(BasicTabbedPaneUI.java:2510)
at javax.swing.plaf.synth.SynthTabbedPaneUI$2.calculateLayoutInfo(SynthTabbedPaneUI.java:883)
at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.layoutContainer(BasicTabbedPaneUI.java:2405)
at java.awt.Container.layout(Container.java:1503)
at java.awt.Container.doLayout(Container.java:1492)
at java.awt.Container.validateTree(Container.java:1688)
at java.awt.Container.validate(Container.java:1623)
at javax.swing.plaf.synth.SynthTabbedPaneUI.ensureCurrentLayout(SynthTabbedPaneUI.java:740)
at javax.swing.plaf.synth.SynthTabbedPaneUI.paint(SynthTabbedPaneUI.java:443)
at javax.swing.plaf.synth.SynthTabbedPaneUI.update(SynthTabbedPaneUI.java:378)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1482)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1413)
at javax.swing.RepaintManager.paint(RepaintManager.java:1206)
at javax.swing.JComponent._paintImmediately(JComponent.java:5169)
at javax.swing.JComponent.paintImmediately(JComponent.java:4980)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:770)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:728)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:677)
at javax.swing.RepaintManager.access$700(RepaintManager.java:59)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1621)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:701)
at java.awt.EventQueue.access$000(EventQueue.java:102)
at java.awt.EventQueue$3.run(EventQueue.java:662)
at java.awt.EventQueue$3.run(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:671)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)