When implementing JSlider's ChangeListener, the event is fired whenever the value changes. I need to get the last value of a JSLider: I don't need every value visited by the slide开发者_如何学编程r, just the last value when the user releases the slider pointer.
Check getValueIsAdjusting() inside stateChanged function.
  JSlider source = (JSlider)e.getSource();
  if (!source.getValueIsAdjusting()) {
       ....
  }
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论