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

MenuBar.snapshot() can buy you a NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8u40
    • 8
    • javafx
    • None

      The tiny attached code triggers the stack below (FX 8 b92, seen on Mac and Win):

      Caused by: java.lang.NullPointerException
      at com.sun.javafx.scene.control.skin.MenuBarSkin.<init>(MenuBarSkin.java:295)
      at javafx.scene.control.MenuBar.createDefaultSkin(MenuBar.java:156)
      at javafx.scene.control.Control.impl_processCSS(Control.java:863)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1191)
      at javafx.scene.Node.processCSS(Node.java:8515)
      at javafx.scene.Scene.doCSSPass(Scene.java:540)
      at javafx.scene.Scene.preferredSize(Scene.java:1578)
      at javafx.scene.Scene.doCSSLayoutSyncForSnapshot(Scene.java:1197)
      at javafx.scene.Node.doSnapshot(Node.java:1755)
      at javafx.scene.Node.snapshot(Node.java:1865)
      at javafxapplicationpasglop.JavaFXApplicationPasGlop.start(JavaFXApplicationPasGlop.java:24)
      at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:810)
      at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:260)
      at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:226)
      at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:223)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:223)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

            jgiles Jonathan Giles
            yjoan Yves Joan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: