Example usage for javax.swing AbstractButton getItemListeners

List of usage examples for javax.swing AbstractButton getItemListeners

Introduction

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

Prototype

@BeanProperty(bound = false)
public ItemListener[] getItemListeners() 

Source Link

Document

Returns an array of all the ItemListeners added to this AbstractButton with addItemListener().

Usage

From source file:Main.java

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

    jb.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent ev) {
            System.out.println("ItemEvent!");
        }//from   w ww  .j a v  a2 s. co  m
    });
    ItemListener[] lis = jb.getItemListeners();
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(jb);
    f.pack();
    f.setVisible(true);
}