Code example for JSlider

Methods: getValue

0
	private void registerLightSlider(final LightView view) {
		final JSlider lightSlider = view.getLightSlider();
		lightSlider.addChangeListener(new ChangeListener() {
			@Override 
			public void stateChanged(ChangeEvent arg0) {
				int value = lightSlider.getValue();
				setLight(value);
			} 
		}); 
	} 
 
	protected void setLight(double value) {
		final LightModel model = (LightModel) mSensorModel;
		final LightView view = (LightView) mSensorView;
		if (model.getReadLight() != value) {
			model.setLight(value);
			view.setLight(value);
		} 
	} 
 
Experience pair programming with AI  Get Codota for Java