private static void attachTo(JSlider c){
  MouseMotionListener[] listeners=c.getMouseMotionListeners();
  for (  MouseMotionListener m : listeners) {
    if (m instanceof TrackListener) {
      c.removeMouseMotionListener(m);
      SnapListener listen=new SnapListener(m,(BasicSliderUI)c.getUI(),c);
      c.addMouseMotionListener(listen);
      c.addMouseListener(listen);
      c.addPropertyChangeListener("UI",listen);
    }
  }
}

private static void attachTo ( JSlider c ) { MouseMotionListener [ ] listeners = c . getMouseMotionListeners ( ) ; for ( MouseMotionListener m : listeners ) { if ( m instanceof TrackListener ) { c . removeMouseMotionListener ( m ) ; SnapListener listen = new SnapListener ( m , ( BasicSliderUI ) c . getUI ( ) , c ) ; c . addMouseMotionListener ( listen ) ; c . addMouseListener ( listen ) ; c . addPropertyChangeListener ( "UI" , listen ) ; } } }
called to attach mouse listeners to the jslider
