Not getting value from JSlider
问题 I am using a JSlider in my program, and have implemented a ChangeListener for the same. public void stateChanged(ChangeEvent e) { JSlider source=(JSlider) e.getSource(); frame_value.setText(Integer.toString(source.getValue())); //Condition to change the frame_no only when user has stopped moving the slider if (!source.getValueIsAdjusting()) { frame_no=(int) source.getValue()-1; if(frame_no<0) frame_no=0; } .... } What is happening is, that whenever the ChangeListener is called, the program