List of usage examples for javax.swing AbstractButton getChangeListeners
@BeanProperty(bound = false)
public ChangeListener[] getChangeListeners()
ChangeListener
s added to this AbstractButton with addChangeListener(). 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); }