UIDefaults defaults = UIManager.getLookAndFeelDefaults(); InputMap ancestorMap = (InputMap)defaults.get("Table.ancestorInputMap");
InputMap ancestorMap = (InputMap) UIManager.get("Table.ancestorInputMap");
  protected void installKeyboardActions()   {    UIDefaults defaults = UIManager.getLookAndFeelDefaults();    InputMap ancestorMap = (InputMap)defaults.get("Table.ancestorInputMap");    InputMapUIResource parentInputMap = new InputMapUIResource();    // FIXME: The JDK uses a LazyActionMap for parentActionMap    ActionMap parentActionMap = new ActionMap();    action = new TableAction();    Object keys[] = ancestorMap.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) ancestorMap.get(stroke);        parentInputMap.put(KeyStroke.getKeyStroke(stroke.getKeyCode(),                                                  stroke.getModifiers()),                           actionString);        parentActionMap.put (actionString,                              new ActionListenerProxy (action, actionString));      }    // Set the UI InputMap-ActionMap pair to be the parents of the    // JTable's InputMap-ActionMap pair    parentInputMap.setParent      (table.getInputMap       (JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent());    parentActionMap.setParent(table.getActionMap().getParent());    table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).      setParent(parentInputMap);    table.getActionMap().setParent(parentActionMap);  }