I am building a grpahic interface with different buttons, and when user clicks a button I use :
actionPerformed(ActionEvent e) {
Object source = e.getSource();
if
else if
else if
...
}
The problem is that when the user clicks a button, actionPerformed(ActionEvent e)
is called, and it enter in the if corresponding to e.getSource();
.
And it executes all instructions in the corresponding if. But I want to make possible that the user clicks different buttons, so that a actionPerformed(ActionEvent e)
{ is called, even if the instructions of the previous actionPerformed(ActionEvent e)
{ is not finish yet.
I don't know if you understand, but thank you if you can help me !