Code example for JSlider

Methods: setRequestFocusEnabledaddChangeListener

0
     * @param liveUpdate 
     *        set to true if you want live update on slider change 
     */ 
    public SliderCellEditor(boolean liveUpdate)
    { 
        slider = new JSlider(0, 1000);
 
        slider.addChangeListener(this);
        slider.setRequestFocusEnabled(false);
 
        table = null;
        this.liveUpdate = liveUpdate;
    } 
 
    @Override 
    public Object getCellEditorValue() 
    { 
        return Integer.valueOf(slider.getValue());
    }