Example usage for javax.swing AbstractButton getChangeListeners

List of usage examples for javax.swing AbstractButton getChangeListeners

Introduction

In this page you can find the example usage for javax.swing AbstractButton getChangeListeners.

Prototype

@BeanProperty(bound = false)
public ChangeListener[] getChangeListeners() 

Source Link

Document

Returns an array of all the ChangeListeners added to this AbstractButton with addChangeListener().

Usage

From source file:Main.java

public static void main(String[] args) {
    AbstractButton jb = new JButton("Press Me");

    jb.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent ev) {
            System.out.println("ChangeEvent!");
        }/*from   w ww  .j a v  a2  s.  c  o m*/
    });
    ChangeListener[] lis = jb.getChangeListeners();
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);
    f.pack();
    f.setVisible(true);
}