public void propertyChange(final PropertyChangeEvent e) {
   if ("defaultButton".equals(e.getPropertyName())) {
     if (e.getNewValue() == null) {
       unloadDefaultButtonKeyBindings((JComponent) e.getSource());
     } else {
       loadDefaultButtonKeyBindings((JComponent) e.getSource());
     }
   }
 }
  protected void installKeyboardActions(final JRootPane root) {
    SwingUtilities.replaceUIActionMap(root, getActionMap(root));

    Utilities.installKeyboardActions(
        root,
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
        "RootPane.ancestorInputMap",
        "RootPane.ancestorInputMap.RightToLeft");
    if (root.getDefaultButton() != null) {
      loadDefaultButtonKeyBindings(root);
    }
  }