UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap focusInputMap = (InputMap) defaults.get("Tree.focusInputMap");
InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap");
  protected void installKeyboardActions()  {    UIDefaults defaults = UIManager.getLookAndFeelDefaults();    InputMap focusInputMap = (InputMap) defaults.get("Tree.focusInputMap");    InputMapUIResource parentInputMap = new InputMapUIResource();    ActionMap parentActionMap = new ActionMap();    action = new TreeAction();    Object keys[] = focusInputMap.allKeys();    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(tree.getInputMap(                                              JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent());    parentActionMap.setParent(tree.getActionMap().getParent());    tree.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).setParent(                                                                              parentInputMap);    tree.getActionMap().setParent(parentActionMap);  }