Two things...
Firstly, NAME
affects the text of button, but if not specified, will also set the actionCommand. Property. Instead I think you're after the ACTION_COMMAND_KEY
property
Secondly, there should actually be little need for it, as the Action
is self contained, hat is, it is it's own ActionListener
, so when actionPerformed
is called on your Action
, you are guaranteed the association