Reputation: 75
I was wondering (if possible) how I could update what a JButton's ActionListener performs. I need to keep one button throughout my whole program, but change what it does depending on the current situation.
Upvotes: 0
Views: 1280
Reputation: 618
At first use removeActionListener() than add new one. Use getActionListeners method to get list of all action listeners for your button.
Upvotes: 2