protected void installKeyboardActions() {
    InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW, map);

    LazyActionMap.installLazyActionMap(optionPane, BasicOptionPaneUI.class, "OptionPane.actionMap");
  }
  protected void installKeyboardActions() {
    InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (inputMap != null) {
      SwingUtilities.replaceUIInputMap(desktop, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
    }
    inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    if (inputMap != null) {
      SwingUtilities.replaceUIInputMap(
          desktop, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
    }

    LazyActionMap.installLazyActionMap(desktop, BasicDesktopPaneUI.class, "DesktopPane.actionMap");
    registerKeyboardActions();
  }