I created an array of JButtons with anonymous ActionListeners and under certain conditions I want to remove all the ActionListeners, b
JButtons
ActionListeners
You can get them with: getActionListeners method:
for( JButton currentButton: button ) { for( ActionListener al : currentButton.getActionListeners() ) { currentButton.removeActionListener( al ); } }
I'm not sure if it will thrown a ConcurrentModificationException though.
ConcurrentModificationException