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

NPE when changing Windows Theme

    Details

      Backports

        Description

        When changing Windows themes from a theme with visual styles (Windows Aero or Windows Basic) to a classic one, NullPointerException could be thrown from Swing code during component tree validation, or InternalError could be thrown during component painting.

        java.lang.NullPointerException
                at com.sun.java.swing.plaf.windows.XPStyle$Skin.getHeight(XPStyle.java:528)
                at com.sun.java.swing.plaf.windows.XPStyle$Skin.getHeight(XPStyle.java:532)
                at com.sun.java.swing.plaf.windows.WindowsLookAndFeel$SkinIcon.getIconHeight(WindowsLookAndFeel.java:2243)
                at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.getTableCellRendererComponent(WindowsTableHeaderUI.java:148)
                at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderRenderer(BasicTableHeaderUI.java:702)
                at javax.swing.plaf.basic.BasicTableHeaderUI.getHeaderHeight(BasicTableHeaderUI.java:737)
                at javax.swing.plaf.basic.BasicTableHeaderUI.createHeaderSize(BasicTableHeaderUI.java:765)
                at javax.swing.plaf.basic.BasicTableHeaderUI.getPreferredSize(BasicTableHeaderUI.java:796)
                at javax.swing.JComponent.getPreferredSize(JComponent.java:1660)
                at javax.swing.ViewportLayout.layoutContainer(ViewportLayout.java:140)
                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.validateTree(Container.java:1697)
                at java.awt.Container.validateTree(Container.java:1697)
                at java.awt.Container.validateTree(Container.java:1697)
                at java.awt.Container.validateTree(Container.java:1697)
                at java.awt.Container.validateTree(Container.java:1697)
                at java.awt.Container.validate(Container.java:1623)
                at java.awt.Window.dispatchEventImpl(Window.java:2717)
                at java.awt.Component.dispatchEvent(Component.java:4687)
                at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
                at java.awt.EventQueue.access$200(EventQueue.java:103)
                at java.awt.EventQueue$3.run(EventQueue.java:694)
                at java.awt.EventQueue$3.run(EventQueue.java:692)
                ...

        java.lang.InternalError: HTHEME is null
                at sun.awt.windows.ThemeReader.paintBackground(Native Method)
                at sun.awt.windows.ThemeReader.paintBackground(ThemeReader.java:119)
                at com.sun.java.swing.plaf.windows.XPStyle$SkinPainter.paintToImage(XPStyle.java:679)
                at sun.swing.CachedPainter.paint0(CachedPainter.java:146)
                at sun.swing.CachedPainter.paint(CachedPainter.java:111)
                at com.sun.java.swing.plaf.windows.XPStyle$Skin.paintSkinRaw(XPStyle.java:625)
                at com.sun.java.swing.plaf.windows.AnimationController.paintSkin(AnimationController.java:253)
                at com.sun.java.swing.plaf.windows.XPStyle$Skin.paintSkin(XPStyle.java:604)
                at com.sun.java.swing.plaf.windows.WindowsTableHeaderUI$XPDefaultRenderer.paint(WindowsTableHeaderUI.java:204)
                at javax.swing.CellRendererPane.paintComponent(CellRendererPane.java:151)
                at javax.swing.plaf.basic.BasicTableHeaderUI.paintCell(BasicTableHeaderUI.java:710)
                at javax.swing.plaf.basic.BasicTableHeaderUI.paint(BasicTableHeaderUI.java:652)
                at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
                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.JViewport.paint(JViewport.java:731)
                at javax.swing.JComponent.paintChildren(JComponent.java:887)
                at javax.swing.JComponent.paint(JComponent.java:1063)
                at javax.swing.JComponent.paintChildren(JComponent.java:887)
                at javax.swing.JComponent.paint(JComponent.java:1063)
                at javax.swing.JComponent.paintChildren(JComponent.java:887)
                at javax.swing.JComponent.paint(JComponent.java:1063)
                at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
                at javax.swing.JComponent.paintChildren(JComponent.java:887)
                at javax.swing.JComponent.paintToOffscreen(JComponent.java:5226)
                at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:295)
                at javax.swing.RepaintManager.paint(RepaintManager.java:1249)
                at javax.swing.JComponent.paint(JComponent.java:1040)
                at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
                at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
                at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
                at java.awt.Container.paint(Container.java:1967)
                at java.awt.Window.paint(Window.java:3877)
                at javax.swing.RepaintManager$3.run(RepaintManager.java:819)
                ...

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  aivanov Alexey Ivanov
                  Reporter:
                  asaha Abhijit Saha
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: