List of usage examples for javax.swing JScrollBar getModel
public BoundedRangeModel getModel()
From source file:BoundedChangeListener.java
public static void main(String args[]) { ChangeListener changeListener = new BoundedChangeListener(); JScrollBar aJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL); BoundedRangeModel model = aJScrollBar.getModel(); model.addChangeListener(changeListener); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(aJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);/*from w w w .j a va 2 s .co m*/ frame.setVisible(true); }
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); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);//from w w w. ja v a 2s .c o m frame.setVisible(true); }
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); System.out.println(model.getValue()); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);/*from w ww.ja v a 2s . c o m*/ frame.setVisible(true); }
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.setExtent(10);//from w w w. ja v a2 s .co m JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200); frame.setVisible(true); }
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.setValueIsAdjusting(true);/*from w ww .j av a 2 s . c o m*/ JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200); frame.setVisible(true); }
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); System.out.println(model.getMinimum()); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);//from www . j a v a 2 s . co m frame.setVisible(true); }
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);/*from w w w . ja v a 2 s .c om*/ frame.setVisible(true); }
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); System.out.println(model.getMaximum()); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);/* ww w. j a v a 2 s.c o m*/ frame.setVisible(true); }
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.setMinimum(10);/* w w w.java2s.co m*/ JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200); frame.setVisible(true); }
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.removeChangeListener(changeListener); JFrame frame = new JFrame("ScrollBars R Us"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(anotherJScrollBar, BorderLayout.NORTH); frame.setSize(300, 200);/*from w ww . j av a 2 s . c o m*/ frame.setVisible(true); }