Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6833947

When using Nimbis, ClassCastExceptions thrown when the GUI for 2D Demo loads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 6u10
    • Fix Version/s: None
    • Component/s: client-libs

      Description

      OPERATING SYSTEM
      ----------------
      All

      FULL JDK VERSION
      ----------------
      1.6.0_10 onwards.

      DESCRIPTION
      -----------
      This looks similar to CR 6785663, but the stack traces are different.

      Load the Java 2D Demo application using the Swing Nimbus Look and feel:

      java -jar -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel Java2Demo.jar

      On opening and closing the application several times the problem will be seen. We different Exceptions on different platforms:

      Linux
      -----
      Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.awt.Color
              at com.sun.java.swing.plaf.nimbus.NimbusStyle.getColorForState(NimbusStyle.java:670)
              at javax.swing.plaf.synth.SynthStyle.getColor(SynthStyle.java:783)
              at javax.swing.plaf.synth.SynthLookAndFeel.paintRegion(SynthLookAndFeel.java:387)
              at javax.swing.plaf.synth.SynthLookAndFeel.update(SynthLookAndFeel.java:351)
              at javax.swing.plaf.synth.SynthPanelUI.update(SynthPanelUI.java:94)
              at javax.swing.JComponent.paintComponent(JComponent.java:763)
              at javax.swing.JComponent.paint(JComponent.java:1027)
              at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122)
              at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:277)
              at javax.swing.RepaintManager.paint(RepaintManager.java:1217)
              at javax.swing.JComponent._paintImmediately(JComponent.java:5070)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
              at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.sun.java.swing.plaf.nimbus.DerivedColor$UIResource cannot be cast to com.sun.java.swing.Painter
              at com.sun.java.swing.plaf.nimbus.NimbusStyle.getBorderPainter(NimbusStyle.java:903)
              at com.sun.java.swing.plaf.nimbus.SynthPainterImpl.paintBorder(SynthPainterImpl.java:102)
              at com.sun.java.swing.plaf.nimbus.SynthPainterImpl.paintPanelBorder(SynthPainterImpl.java:960)
              at javax.swing.plaf.synth.SynthPanelUI.paintBorder(SynthPanelUI.java:114)
              at javax.swing.plaf.synth.SynthBorder.paintBorder(SynthBorder.java:46)
              at javax.swing.JComponent.paintBorder(JComponent.java:922)
              at javax.swing.JComponent.paint(JComponent.java:1028)
              at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122)
              at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:277)
              at javax.swing.RepaintManager.paint(RepaintManager.java:1217)
              at javax.swing.JComponent._paintImmediately(JComponent.java:5070)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
              at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Windows
      -------
      Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.FontUIResource cannot be cast to com.sun.java.swing.Painter
              at com.sun.java.swing.plaf.nimbus.NimbusStyle.getBackgroundPainter(NimbusStyle.java:829)
              at com.sun.java.swing.plaf.nimbus.SynthPainterImpl.paintBackground(SynthPainterImpl.java:85)
              at com.sun.java.swing.plaf.nimbus.SynthPainterImpl.paintPanelBackground(SynthPainterImpl.java:943)
              at javax.swing.plaf.synth.SynthPanelUI.update(SynthPanelUI.java:95)
              at javax.swing.JComponent.paintComponent(JComponent.java:763)
              at javax.swing.JComponent.paint(JComponent.java:1029)
              at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124)
              at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:277)
              at javax.swing.RepaintManager.paint(RepaintManager.java:1220)
              at javax.swing.JComponent._paintImmediately(JComponent.java:5072)
              at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803)
              at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
              at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
              at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Though the exceptions are thrown the GUI is able to load successfully and there is no effect on the functionality of the application. The problem is intermittent in nature.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peterz Peter Zhelezniakov (Inactive)
                Reporter:
                dkorbel David Korbel (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: