Java JButton removeAllListeners(JButton bouton)

Here you can find the source of removeAllListeners(JButton bouton)

Description

remove All Listeners

License

Apache License

Declaration

public static void removeAllListeners(JButton bouton) 

Method Source Code


//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);
        }
    }
}

Related

  1. nullifyButtonUI(final JButton button)
  2. orderOKCancelButtons(JButton okButton, JButton cancelButton)
  3. reduceNimbusButtonMargin(final JButton button)
  4. registerCancelButton(final JButton cancelButton)
  5. removeAllActionListeners(JButton button)
  6. removeMargins(JButton button)
  7. renderImageOnly(JButton button)
  8. setButtonNo(JButton anButton)
  9. setCancelButton(final JRootPane rp, final JButton b)