public class Main { public static void main(String[] argv) throws Exception {
JSlider slider = new JSlider();
slider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) {
JSlider slider = (JSlider) evt.getSource(); if (!slider.getValueIsAdjusting()) { int value = slider.getValue();
System.out.println(value);
}
}
});
}
}