title: Menu item not cast node javafx scene
body: <p>I am making a JavaFX app. I have create a Menuitem <strong>About</strong>. Upon clicking on the <strong>About</strong> Menuitem it will display a new window with some info about my app. The window is a <code>Anchor Pane</code> 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 <code>Window existingWindow = ((Node) event.getSource()).getScene().getWindow();</code> but i can't use this as am getting error similar to this <strong>Menu item not cast node javafx scene</strong>. How can I achieve this goal?  </p>