code: protected void configureAccelerator(AbstractButton button, KeyStroke keystrokeAccelerator) {
          if ((button instanceof JMenuItem) && !(button instanceof JMenu)) {
              ((JMenuItem)button).setAccelerator(keystrokeAccelerator);
          }
      }
docs: Sets the given keystroke accelerator on the given button.
  
  @param button The button. May be null.
  @param keystrokeAccelerator The accelerator. May be null.