if you don't use setActionCommand(..), it defaults to the button's text.
Joined: Apr 12, 2006
I think I am not explaining well what the problem is.
the problem is again how to listen for the action of those buttons, and once we get an action how to determine which button is it. maybe your last reply answers the second question but where can I check this value ?
Joined: Jun 09, 2003
in a simple case (not that you'd actually do it this way), consider the buttons on a calculator
if(button.getActionCommand().equals("1"))//id's the button displaying the "1"
Typically, I wouldn't use action commands for that. Instead I would register a new listener to each button, so that each listener knows which button it is responsible for.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus