Class EscapeAction

  • All Implemented Interfaces:
    ActionListener, Serializable, Cloneable, EventListener, Action

    public class EscapeAction
    extends AbstractAction
    Convenience Action to dispose of a Swing Window by using the Escape key. Before disposing of the window the Action will first attempt to hide any popups. In this case the user will need to invoke the Escape key a second time before the Window is disposed.
    See Also:
    Serialized Form
    • Method Detail

      • register

        public static void register​(JDialog dialog)
        Registers an EscapeAction on the specified JDialog
        Parameters:
        dialog - the JDialog the EscapeAction is registered with
      • register

        public static void register​(JRootPane rootPane)
        Registers an EscapeAction on the specified JRootPane
        Parameters:
        rootPane - the JRootPane the EscapeAction is registered with
      • actionPerformed

        public void actionPerformed​(ActionEvent e)
        Implement the Escape Action. First attempt to hide a popup menu. If no popups are found then dispose the window.