Here you can find the source of removeAllListeners(JButton bouton)
public static void removeAllListeners(JButton bouton)
//package com.java2s; //License from project: Apache License import java.awt.event.ActionListener; import java.awt.event.ItemListener; import javax.swing.JButton; import javax.swing.JComboBox; public class Main { public static void removeAllListeners(JButton bouton) { for (ActionListener al : bouton.getActionListeners()) { bouton.removeActionListener(al); }//from www . j ava 2 s.c o m } public static void removeAllListeners(JComboBox box) { for (ItemListener al : box.getItemListeners()) { box.removeItemListener(al); } } }