private static Object getAction(KeyEvent e, JComponent comp) {
    @SuppressWarnings("deprecation") KeyStroke stroke = KeyStroke.getKeyStroke(e.getKeyCode(), e.getModifiers());
    return comp.getInputMap().get(stroke);
  }
private static Object getAction(KeyEvent e, JComponent comp)