FileDocCategorySizeDatePackage
SliderExample.javaAPI DocExample984Mon Nov 09 12:45:54 GMT 1998None

SliderExample

public class SliderExample extends JPanel

Fields Summary
Constructors Summary
public SliderExample()


    super(true);

    this.setLayout(new BorderLayout());
    JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 50, 25);
    slider.setMinorTickSpacing(2);
    slider.setMajorTickSpacing(10);
    slider.setPaintTicks(true);
    slider.setPaintLabels(true);

    // Note that the following line is really unnecessary. By setting a
    // positive integer to the major tick spacing and setting the paintLabel
    // property to true, it's done for us!

    slider.setLabelTable(slider.createStandardLabels(10));
    add(slider, BorderLayout.CENTER);
  
Methods Summary
public static voidmain(java.lang.String[] s)

    JFrame frame = new JFrame("Slider");
    frame.addWindowListener(new BasicWindowMonitor());
    frame.setContentPane(new SliderExample());
    frame.pack();
    frame.setVisible(true);