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

Setting MenuBar as Scene root triggers NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      javafx-sdk2.2.0-beta-b15

      Description

      The following two lines

      MenuBar menuBar = new MenuBar();
      Scene scene = new Scene(menuBar);

      trigger the following NPE:

      SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: MenuBar[id=null, styleClass=root menu-bar], name: skinClassName, value: com.sun.javafx.scene.control.skin.MenuBarSkin]' for control MenuBar[id=null, styleClass=root menu-bar]
      java.lang.NullPointerException
      at com.sun.javafx.scene.control.skin.MenuBarSkin.<init>(MenuBarSkin.java:323)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at javafx.scene.control.Control.loadSkinClass(Control.java:992)
      at javafx.scene.control.Control.access$500(Control.java:71)
      at javafx.scene.control.Control$12.invalidated(Control.java:920)
      at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:127)
      at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:161)
      at com.sun.javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:71)
      at javafx.scene.control.Control$12.set(Control.java:912)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:59)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:31)
      at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
      at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:848)
      at javafx.scene.Node.impl_processCSS(Node.java:7324)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
      at javafx.scene.control.Control.impl_processCSS(Control.java:1102)
      at javafx.scene.Node.processCSS(Node.java:7292)
      at javafx.scene.Scene.doCSSPass(Scene.java:444)
      at javafx.scene.Scene.preferredSize(Scene.java:1411)
      at javafx.scene.Scene.impl_preferredSize(Scene.java:1478)
      at javafx.stage.Window$10.invalidated(Window.java:719)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      at javafx.stage.Window.setShowing(Window.java:782)
      at javafx.stage.Window.show(Window.java:797)
      at javafx.stage.Stage.show(Stage.java:229)
      at Bug.start(Bug.java:63)
      at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
      at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:662)

      SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for MenuBar[id=null, styleClass=root menu-bar]

        Attachments

          Activity

            People

            Assignee:
            psomashe Parvathi Somashekar (Inactive)
            Reporter:
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: