parentInputMap.put(KeyStroke.getKeyStroke (((KeyStroke)keys[i]).getKeyCode(), convertModifiers (((KeyStroke)keys[i]).getModifiers())), (String)focusInputMap.get((KeyStroke)keys[i]));
KeyStroke stroke = (KeyStroke)keys[i]; String actionString = (String) focusInputMap.get(stroke); parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(), stroke.getModifiers()), actionString);
  protected void installKeyboardActions()  {    UIDefaults defaults = UIManager.getLookAndFeelDefaults();    InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap");    InputMapUIResource parentInputMap = new InputMapUIResource();    // FIXME: The JDK uses a LazyActionMap for parentActionMap    ActionMap parentActionMap = new ActionMap();    action = new ListAction();    Object keys[] = focusInputMap.allKeys();    // Register key bindings in the UI InputMap-ActionMap pair    // Note that we register key bindings with both the old and new modifier    // masks: InputEvent.SHIFT_MASK and InputEvent.SHIFT_DOWN_MASK and so on.    for (int i = 0; i < keys.length; i++)      {        parentInputMap.put(KeyStroke.getKeyStroke                           (((KeyStroke)keys[i]).getKeyCode(), convertModifiers                            (((KeyStroke)keys[i]).getModifiers())),                            (String)focusInputMap.get((KeyStroke)keys[i]));        parentInputMap.put(KeyStroke.getKeyStroke                           (((KeyStroke)keys[i]).getKeyCode(),                             ((KeyStroke)keys[i]).getModifiers()),                            (String)focusInputMap.get((KeyStroke)keys[i]));        parentActionMap.put        ((String)focusInputMap.get((KeyStroke)keys[i]), new ActionListenerProxy         (action, (String)focusInputMap.get((KeyStroke)keys[i])));      }    parentInputMap.setParent(list.getInputMap().getParent());    parentActionMap.setParent(list.getActionMap().getParent());    list.getInputMap().setParent(parentInputMap);    list.getActionMap().setParent(parentActionMap);  }