How to detect if the JSpinner value has changed?

0

I want to perform an action whenever the value of JSpinner is changed. How do I do this?

    
asked by anonymous 23.01.2018 / 02:36

1 answer

2

Just apply the ChangeListener event to the component :

spinner.addChangeListener(e -> {
    //faça algo quando o valor alterar
});

Demo:

    
23.01.2018 / 11:08