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

Removing and then re-adding MenuItem's causes sub MenuItems not to display

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 7u15
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
      None

      Description

      If I create a MenuItem with sub items:

              MenuItem t1 = MenuItemBuilder.create().text("t1").build();
              MenuItem t2 = MenuItemBuilder.create().text("t2").build();
              Menu test = MenuBuilder.create().text("TEST").items(t1, t2).build();

      add it to a MenuBar, remove it and then re-add you get the following exception and the sub menu items do not display.

      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | java.lang.NullPointerException
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.PopupStage.getOwnerScene(PopupStage.java:56)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.PopupScene.sceneChanged(PopupScene.java:27)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassScene.setGlassStage(GlassScene.java:191)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.ViewScene.setGlassStage(ViewScene.java:69)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.PopupScene.setGlassStage(PopupScene.java:17)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.PopupStage.createTKScene(PopupStage.java:62)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene.impl_initPeer(Scene.java:645)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.stage.Window$10.invalidated(Window.java:716)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.stage.Window.setShowing(Window.java:781)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.stage.Window.show(Window.java:796)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.stage.PopupWindow.showImpl(PopupWindow.java:368)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.stage.PopupWindow.show(PopupWindow.java:326)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.control.ContextMenu.doShow(ContextMenu.java:275)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.control.ContextMenu.show(ContextMenu.java:251)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent.showSubmenu(ContextMenuContent.java:781)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent.access$1900(ContextMenuContent.java:83)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent$7.changed(ContextMenuContent.java:734)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent$7.changed(ContextMenuContent.java:726)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:367)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:197)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.access$100(ReadOnlyBooleanWrapper.java:167)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:163)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:128)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.control.Menu.setShowing(Menu.java:180)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.control.Menu.show(Menu.java:376)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer$3.handle(ContextMenuContent.java:1103)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer$3.handle(ContextMenuContent.java:1093)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.event.Event.fireEvent(Event.java:171)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventQueue.fire(EventQueue.java:27)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene$MouseHandler.handleEnterExit(Scene.java:3252)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene$MouseHandler.process(Scene.java:3310)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene$MouseHandler.process(Scene.java:3168)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3123)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2265)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at java.security.AccessController.doPrivileged(Native Method)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.glass.ui.View.handleMouseEvent(View.java:528)
      15/04/2013 2:26:05 PM [SEVERE ][13 ] stderr | at com.sun.glass.ui.View.notifyMouse(View.java:922)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | java.lang.NullPointerException
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.PopupStage.setVisible(PopupStage.java:102)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.Window$10.invalidated(Window.java:744)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.Window.setShowing(Window.java:781)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.Window.hide(Window.java:806)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.PopupWindow.hide(PopupWindow.java:390)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.scene.control.ContextMenu.hide(ContextMenu.java:289)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent.hideSubmenu(ContextMenuContent.java:787)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent.access$1800(ContextMenuContent.java:83)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent$7.changed(ContextMenuContent.java:731)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.ContextMenuContent$7.changed(ContextMenuContent.java:726)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:367)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:197)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.access$100(ReadOnlyBooleanWrapper.java:167)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:163)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:128)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.scene.control.Menu.setShowing(Menu.java:180)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.scene.control.Menu.hide(Menu.java:393)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.scene.control.Menu.hide(Menu.java:390)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.MenuBarSkin$18.onChanged(MenuBarSkin.java:574)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.collections.MapListenerHelper$SingleChange.fireValueChangedEvent(MapListenerHelper.java:133)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(MapListenerHelper.java:47)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.collections.ObservableMapWrapper.callObservers(ObservableMapWrapper.java:94)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.collections.ObservableMapWrapper.put(ObservableMapWrapper.java:146)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.scene.control.skin.MenuButtonSkin$1.handle(MenuButtonSkin.java:64)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.PopupWindow.doAutoHide(PopupWindow.java:488)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.PopupWindow$PopupEventRedirector.handleFocusUngrabEvent(PopupWindow.java:710)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.stage.PopupWindow$PopupEventRedirector.handleRedirectedEvent(PopupWindow.java:647)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:85)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:22)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:31)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventRedirector.redirectEvent(EventRedirector.java:103)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:82)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:22)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:31)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at javafx.event.Event.fireEvent(Event.java:171)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.stage.WindowPeerListener.focusUngrab(WindowPeerListener.java:93)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:60)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassWindowEventHandler.run(GlassWindowEventHandler.java:18)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at java.security.AccessController.doPrivileged(Native Method)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:91)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.glass.ui.Window.handleWindowEvent(Window.java:1009)
      15/04/2013 2:26:07 PM [SEVERE ][13 ] stderr | at com.sun.glass.ui.Window.notifyFocusUngrab(Window.java:997)
      [GC 301583K->136324K(399680K), 0.0282980 secs]


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psomashe Parvathi Somashekar (Inactive)
                Reporter:
                cdayjfx Craig Day (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: