UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap");
InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap");
  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    for (int i = 0; i < keys.length; i++)      {        KeyStroke stroke = (KeyStroke)keys[i];        String actionString = (String) focusInputMap.get(stroke);        parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(),                                                  stroke.getModifiers()),                           actionString);        parentActionMap.put (actionString,                              new ActionListenerProxy(action, actionString));      }    // Register the new InputMap-ActionMap as the parents of the list's    // InputMap and ActionMap    parentInputMap.setParent(list.getInputMap().getParent());    parentActionMap.setParent(list.getActionMap().getParent());    list.getInputMap().setParent(parentInputMap);    list.getActionMap().setParent(parentActionMap);  }