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])));
SwingUtilities.replaceUIActionMap(tree, getActionMap());
  protected void installKeyboardActions()  {    InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap");    InputMapUIResource parentInputMap = new InputMapUIResource();    ActionMap parentActionMap = new ActionMapUIResource();    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);  }