code: protected ActionEvent createEventToFire (ActionEvent proto)
      {
          String actionCommand = proto.getActionCommand();
          if (actionCommand == null) {
              actionCommand = getActionCommand();
          }
  
          Object arg = (proto instanceof CommandEvent)
              ? ((CommandEvent) proto).getArgument() : null;
  
          // if we were passed an action event, or if it was a command event
          // with a null arg...
          if (arg == null) {
              // ...use ours
              arg = getActionArgument();
          }
  
          if (arg == null) {
              // just create a plain ActionEvent
              return new ActionEvent(CommandButton.this,
                                     ActionEvent.ACTION_PERFORMED, actionCommand,
                                     proto.getWhen(), proto.getModifiers());
          } else {
              // if we found an arg somewhere, create a CommandEvent
              return new CommandEvent(CommandButton.this, actionCommand, arg,
                                      proto.getWhen(), proto.getModifiers());
          }
      }
docs: Create the event to fire from the prototype.
  If this method were broken out in AbstractButton, we wouldn't even
  have had to override fireActionPerformed().