Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101421

Hiding a Stage cannot be cancelled in the onHiding's handle method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • Windows7

      After setting an EventHandler to a Stage via setOnHiding(...) the Stage is unconditionally hidden when the handler's handle(...) method returns. IMO the primary purpose of differentiating between onHiding and onHidden is to permit canceling the hiding in the former.

      Perhaps this could be implemented by not hiding the Stage if the WindowEvent is consume()d in the onHiding handler, or maybe by providing a defaultCloseOperation as in Swing's top level windows.

      The first suggested approach could facilitate conditionally consume()ing a WindowEvent.WINDOW_HIDING in an EventFilter to prevent the window from being closed.

      Discussion here: http://forums.oracle.com/forums/thread.jspa?threadID=2245058

      db

            lnerad Ľubomír Nerád (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: