I wonder whether everything else stops while ActionListener running?
If I loop a button ActionListener when this button is pressed, I can not invoke another button ActionListener
I want to toggle 2 actions of 2 buttons:
- Press btn1 --> do btn1 ActionListener
{ Flag1 = true, Flag2 = false
while Flag1 = true, do action1
}
- Press btn2 --> do btn2 ActionListener
{ Flag1 = false, Flag2 = true
while Flag2 = true, do action2
}
But when invoke btn1, everything else is out of control