void (ItemEvent event) { boolean enabled = mySecondStrokeEnable.isSelected(); mySecondStroke.setEnabled(enabled); ShortcutTextField component = !enabled || null == myFirstStroke.getKeyStroke() ? myFirstStroke : mySecondStroke; setShortcut(newShortcut()); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(component, true)); }