List of usage examples for javax.swing BoundedRangeModel setRangeProperties
void setRangeProperties(int value, int extent, int min, int max, boolean adjusting);
From source file:Main.java
public static void main(String args[]) throws Exception { ChangeListener changeListener = new BoundedChangeListener(); JScrollBar anotherJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); BoundedRangeModel model = anotherJScrollBar.getModel(); model.addChangeListener(changeListener); model.setRangeProperties(10, 10, 0, 20, true); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);/* w w w .j ava2 s .co m*/ frame.setVisible(true); }