editor.getActionMap().put(ACTION_SWITCH_WINDOW, switchWindowAction); editor.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.ALT_MASK), ACTION_SWITCH_WINDOW);