Example usage for javax.swing JSpinner getChangeListeners

List of usage examples for javax.swing JSpinner getChangeListeners

Introduction

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

Prototype

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

Source Link

Document

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

Usage

From source file:Main.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("JSpinner Dates");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    ChangeListener listener = new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            System.out.println("Source: " + e.getSource());
        }/*  w w w . j  av  a 2  s .com*/
    };

    SpinnerModel model3 = new SpinnerNumberModel();
    JSpinner spinner3 = new JSpinner(model3);
    spinner3.addChangeListener(listener);

    ChangeListener[] changeListeners = spinner3.getChangeListeners();

    frame.add(spinner3, BorderLayout.SOUTH);

    frame.setSize(200, 90);
    frame.setVisible(true);

}