title: Java Swing: How to remove an anonymous ActionListener from a component
body: <p>I created an array of <code>JButtons</code> with anonymous <code>ActionListeners</code> and under certain conditions I want to remove all the <code>ActionListeners</code>, but the <code>.removeActionListeners</code> method requires an <code>ActionListener</code> as an argument. How would I go about removing the action listeners?</p>
  
  <pre><code>for (int i=0; i &lt; button.length; i++){
      button[i] = new JButton();
      button[i].addActionListener(listener.new ButtonListener());
  }
  </code></pre>