FX should be able to handle Glass's WindowEvent.CLOSE, and check with the user code to verify if the app wants to close the window.
Currently the Glass's implementation of WindowStage calls close() unconditionally.
The WindowEvent.CLOSE is generated when user clicks the "Close" button in the title-bar of a window, or when the user preses Alt+F4 key (on MS Windows). Choosing the "Close" menuitem in the window's system menu (Alt+Space) also triggers the event.
Currently the Glass's implementation of WindowStage calls close() unconditionally.
The WindowEvent.CLOSE is generated when user clicks the "Close" button in the title-bar of a window, or when the user preses Alt+F4 key (on MS Windows). Choosing the "Close" menuitem in the window's system menu (Alt+Space) also triggers the event.
- duplicates
-
JDK-8101097 No way to cancel Stage closing
- Resolved