JDK-8099471 : Support for conditional closing of windows in FX
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2010-11-19
  • Updated: 2015-06-16
  • Resolved: 2012-07-30
Related Reports
Duplicate :  
Description
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.
Comments
Duplicate of http://javafx-jira.kenai.com/browse/RT-14297 ?
12-07-2011

This one is pretty fundamental to any desktop application. By not allowing users to prompt and optionally cancel the closing of a stage, applications written in Fx can lose the user's data. I think we should address this one for Presidio.
11-07-2011

There is currently no public FX API in support of this. Yes, this would be a good feature, but unlikely we will do it for Presidio.
06-12-2010