Code example for JSlider

Methods: getMaximumgetMinimum

0
			double logMax = Math.log(max);
			double logValue = (Math.log(value) - logMin) / (logMax - logMin);
			double scale = slider.getMaximum() - slider.getMinimum();
			sliderValue = (int) (logValue * scale + slider.getMinimum());
		} else { 
			double scale = (slider.getMaximum() - slider.getMinimum()) / (max - min);
			sliderValue = (int) ((value - min) * scale + 0.5 + slider.getMinimum());
		} 
		setSliderValue(sliderValue);
	} 
 
	protected void setSliderValue(int value) {
		slider.removeChangeListener(this);
		slider.setValue(value);
		slider.addChangeListener(this);
	} 
 
	/** 
 	 * Update the text field 
 	 * @param value new value