コード例 #1
0
 public void propertyChange(final PropertyChangeEvent e) {
   if ("defaultButton".equals(e.getPropertyName())) {
     if (e.getNewValue() == null) {
       unloadDefaultButtonKeyBindings((JComponent) e.getSource());
     } else {
       loadDefaultButtonKeyBindings((JComponent) e.getSource());
     }
   }
 }
コード例 #2
0
  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);
    }
  }