Registers key events for a Ctrl-W and ESC with an ActionListener that will take care of disposing the window.
(JRootPane root,
ActionListener disposer)
| 881 | * that will take care of disposing the window. |
| 882 | */ |
| 883 | static public void registerWindowCloseKeys(JRootPane root, |
| 884 | ActionListener disposer) { |
| 885 | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); |
| 886 | root.registerKeyboardAction(disposer, stroke, |
| 887 | JComponent.WHEN_IN_FOCUSED_WINDOW); |
| 888 | |
| 889 | stroke = KeyStroke.getKeyStroke('W', SHORTCUT_KEY_MASK); |
| 890 | root.registerKeyboardAction(disposer, stroke, |
| 891 | JComponent.WHEN_IN_FOCUSED_WINDOW); |
| 892 | } |
| 893 | |
| 894 | |
| 895 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
no outgoing calls
no test coverage detected