Home:ALL Converter>Menu item not cast node javafx scene

Menu item not cast node javafx scene

Ask Time:2018-01-15T02:32:06         Author:Galib Mirza

Json Formatter

I am making a JavaFX app. I have create a Menuitem About. Upon clicking on the About Menuitem it will display a new window with some info about my app. The window is a Anchor Pane with custom close button. I have set the stage undercoated at run time. I want to close this window without closing my main application. I don't want to set its visibility turn off on method call. I see some solution in net like Window existingWindow = ((Node) event.getSource()).getScene().getWindow(); but i can't use this as am getting error similar to this Menu item not cast node javafx scene. How can I achieve this goal?

Author:Galib Mirza,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/48252837/menu-item-not-cast-node-javafx-scene
yy