Title: Help
You could set a different actionCommand to each button. --------->                   button1.setActionCommand("Button1") ;
 
Then in the ActionListener class you could inside actionPerformed(ActionEvent e) method to "ask" for events actionCommand and know which button started the action.
 
        if (e.getActionCommand().equals("Button1"))
       {
            ...
        }
        else if (e.getActionCommand().equals("Button2"))
        {
            ...
        }
 
 
-----Original Message-----
From: Joćo Paulo Menegatti [mailto:[EMAIL PROTECTED]]
Sent: lunes 27 de agosto de 2001 14:10
To: [EMAIL PROTECTED]
Subject: [JAVA3D] same Action Listener for buttons

hi, 
do I have several buttons using a same Action Listener, as I will know that button was clicked? 
 
Thank you for the attention

Reply via email to