Code example for Scrollbar

Methods: setValue

0
		Integer id = new Integer(imp.getID());
		activeImpID = id;
		int w = imp.getWidth();
		int h = imp.getHeight();
		this.theta = 0;
		slider.setValue((int) (theta * 180 / Math.PI));
		this.isReflected0 = false;
		reflect0.setState(isReflected0);
		this.isReflected1 = false;
		reflect1.setState(isReflected1);
		this.length = Math.min(w, h) / 4;
		this.p = new Point(w / 2, h / 2);
		path = new GeneralPath();
		path.moveTo(p.x - length, p.y);
		path.lineTo(p.x + length, p.y);
		path.moveTo(p.x, p.y - length);
		path.lineTo(p.x, p.y + length);
		stroke = new BasicStroke(1, BasicStroke.CAP_ROUND,
				BasicStroke.JOIN_MITER);
		imp.setOverlay(path, Color.BLUE, stroke);
Connect your IDE to all the code out there  Get Codota for Java