void (JComponent component, final GrTypeComboBox combo) { final AnAction arrow = new AnAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { if (e.getInputEvent() instanceof KeyEvent) { final int code = ((KeyEvent)e.getInputEvent()).getKeyCode(); scrollBy(code == KeyEvent.VK_DOWN ? 1 : code == KeyEvent.VK_UP ? -1 : 0, combo); } } }; final KeyboardShortcut up = new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_DOWN_MASK), null); final KeyboardShortcut down = new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_DOWN_MASK), null); arrow.registerCustomShortcutSet(new CustomShortcutSet(up, down), component); }