Is there any way i could remove all the listeners from a JButton?
I've encountered this problem as i defined most of my button listeners as following:

s_UpdateButtonView.addActionListener(new ActionListener () {


public void actionPerformed(ActionEvent e) {
Now, in order to avoid some pretty nasty bugs i need to remove all the listeners for an object. I would have thought that adding a listener inside an If condition would only restrict it's usage to the times when the if condition is true, however it seems that this is not correct...
I've tried looking it up on google, but i found some pretty ugly code, things that i cant understand at all and neither that i can paste.
Now i know there is no removeAllListeners() method but i thought there is some way of detecting the names of Anonymous ( is that how are they called?) Listeners, so i can remove them with removeActionListener();?
Thank you very much