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