actionCommand

Sets the command string a button puts on the ActionEvent it fires, read back as event.actionCommand. It is what tells two buttons apart inside one shared listener, and it stays put when the button's text changes with the locale. null restores the default, where a button reports its own text as the command.

Applies to everything built on a button - buttons, check boxes, radio buttons, toggle buttons, and every kind of menu item. Requires an AbstractButton target.

Return

this chain with the action command declared on it.

Parameters

command

the command string carried by the button's action events.

See also