Scrollbar

A Scrollbar is a "slider" widget containing an integer value. The range of the integer value is set during Scrollbar construction. Both horizontal and vertical sliders are available.



Corresponding source code:

import java.applet.*;
import java.awt.*;
public class ScrollbarWidget extends Applet {
    public void init() {
        // using a GridLayout ensures Scrollbar fills applet
        setLayout(new GridLayout(1,1));
        Scrollbar sb;
        sb = new Scrollbar(Scrollbar.HORIZONTAL,
                           0,  // initial value is 0
                          10,  // slide control size
                        -100,100); // range is [-100,100]
        add(sb);
    }
}

Method(s) of note: