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"))
{
...
}
|
Re: [JAVA3D] same Action Listener for buttons
Illarramendi Amilibia, Aitor Tue, 28 Aug 2001 00:04:24 -0700
Title: Help
- [JAVA3D] same Action Listener for buttons Joćo Paulo Menegatti
- Re: [JAVA3D] same Action Listener for bu... Illarramendi Amilibia, Aitor
- Re: [JAVA3D] same Action Listener for bu... Renoir Sewjee