View Single Post
12-26-2007, 12:29 PM
#3
Seanneo is offline Seanneo
Status: Junior Member
Join date: May 2007
Location:
Expertise:
Software:
 
Posts: 26
iTrader: 1 / 100%
 

Seanneo is on a distinguished road

  Old

thx Dr John for your reply i actually figured this one out by myself, i had searched the web for ages and not one site had something on it...

I set a string in this case i have called it 'whichButton' to the .getActionCommand(); of action 'e' and then just create a couple of if/else statements so it knows what to do depending on which action(button) the getActionCommand gets (buttons not shown in code).

Code:
public void actionPerformed(ActionEvent e)
                    {
                        String whichButton = e.getActionCommand ();

                        if ( whichButton.equals ("Button1"))
                        {
                        }
                        else
                    }
so it was very similar to what you described,
thx again
Seanneo