When changing the StageStyle of a Stage twice by generating a new Stage with the new StageStyle and using the "old" Scene, a NullPointerException is thrown when clicking on the ChoiceBox:
java.lang.NullPointerException
at com.sun.javafx.scene.control.skin.ContextMenuContent.getScreenHeight(ContextMenuContent.java:289)
at com.sun.javafx.scene.control.skin.ContextMenuContent.computePrefHeight(ContextMenuContent.java:268)
at javafx.scene.Parent.prefHeight(Parent.java:813)
at javafx.scene.layout.Region.prefHeight(Region.java:1041)
at javafx.scene.control.PopupControl.recalculatePrefHeight(PopupControl.java:659)
at javafx.scene.control.PopupControl.prefHeight(PopupControl.java:593)
at javafx.scene.control.ContextMenu.show(ContextMenu.java:239)
at com.sun.javafx.scene.control.skin.ChoiceBoxSkin.handleControlPropertyChanged(ChoiceBoxSkin.java:234)
at com.sun.javafx.scene.control.skin.SkinBase$4.changed(SkinBase.java:263)
at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:67)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:156)
at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.access$100(ReadOnlyBooleanWrapper.java:126)
at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:122)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:89)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:122)
at javafx.scene.control.ChoiceBox.show(ChoiceBox.java:212)
at com.sun.javafx.scene.control.behavior.ChoiceBoxBehavior.mousePressed(ChoiceBoxBehavior.java:112)
at com.sun.javafx.scene.control.skin.SkinBase$5.handle(SkinBase.java:317)
at com.sun.javafx.scene.control.skin.SkinBase$5.handle(SkinBase.java:311)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:56)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:162)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:115)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:47)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2785)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2606)
at javafx.scene.Scene$MouseHandler.access$1300(Scene.java:2579)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1252)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:1857)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:203)
at com.sun.glass.ui.View.handleMouseEvent(View.java:288)
at com.sun.glass.ui.View.notifyMouse(View.java:548)
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)
java.lang.NullPointerException
at com.sun.javafx.scene.control.skin.ContextMenuContent.getScreenHeight(ContextMenuContent.java:289)
at com.sun.javafx.scene.control.skin.ContextMenuContent.computePrefHeight(ContextMenuContent.java:268)
at javafx.scene.Parent.prefHeight(Parent.java:813)
at javafx.scene.layout.Region.prefHeight(Region.java:1041)
at javafx.scene.control.PopupControl.recalculatePrefHeight(PopupControl.java:659)
at javafx.scene.control.PopupControl.prefHeight(PopupControl.java:593)
at javafx.scene.control.ContextMenu.show(ContextMenu.java:239)
at com.sun.javafx.scene.control.skin.ChoiceBoxSkin.handleControlPropertyChanged(ChoiceBoxSkin.java:234)
at com.sun.javafx.scene.control.skin.SkinBase$4.changed(SkinBase.java:263)
at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:67)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:181)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:64)
at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:156)
at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.access$100(ReadOnlyBooleanWrapper.java:126)
at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:122)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:89)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:122)
at javafx.scene.control.ChoiceBox.show(ChoiceBox.java:212)
at com.sun.javafx.scene.control.behavior.ChoiceBoxBehavior.mousePressed(ChoiceBoxBehavior.java:112)
at com.sun.javafx.scene.control.skin.SkinBase$5.handle(SkinBase.java:317)
at com.sun.javafx.scene.control.skin.SkinBase$5.handle(SkinBase.java:311)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:56)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:162)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:115)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:47)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2785)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2606)
at javafx.scene.Scene$MouseHandler.access$1300(Scene.java:2579)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1252)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:1857)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:203)
at com.sun.glass.ui.View.handleMouseEvent(View.java:288)
at com.sun.glass.ui.View.notifyMouse(View.java:548)
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)