ActionMapUIResource am = new ActionMapUIResource(); am.put("press", new DefaultPressAction(rp)); am.put("release", new DefaultReleaseAction(rp)); SwingUtilities.replaceUIActionMap(rp, am);      ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp); SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW, im);
  protected void installKeyboardActions(JRootPane rp)  {    // We currently do not install any keyboard actions here.    // This method is here anyway for compatibility and to provide    // the necessary hooks to subclasses.    }