Here you can find the source of removeAllActionListeners(JButton button)
public static void removeAllActionListeners(JButton button)
//package com.java2s; //License from project: Open Source License import java.awt.event.ActionListener; import javax.swing.JButton; public class Main { public static void removeAllActionListeners(JButton button) { ActionListener[] listeners = button.getActionListeners(); for (int i = 0; i < listeners.length; i++) { button.removeActionListener(listeners[i]); }/*w ww. jav a2 s. co m*/ } }