import java.awt.*;
import java.applet.*;

public class SampleScrollbars1
extends      Applet
{
    Scrollbar x;
    Scrollbar y;
    Scrollbar width;
    Scrollbar height;
    Scrollbar startAngle;
    Scrollbar arcAngle;

    // A production applet should certainly use a layout manager,
    // but I don't want to distract attention from the scrollbar
    // machinery here:
    public void init() {
        x          = new Scrollbar(Scrollbar.VERTICAL,128,64, 0,255); add(x);
        y          = new Scrollbar(Scrollbar.VERTICAL,128,64,80,255); add(y);
        width      = new Scrollbar(Scrollbar.VERTICAL,128,64, 0,255); add(width);
        height     = new Scrollbar(Scrollbar.VERTICAL,128,64, 0,255); add(height);
        startAngle = new Scrollbar(Scrollbar.VERTICAL,128,64, 0,255); add(startAngle);
        arcAngle   = new Scrollbar(Scrollbar.VERTICAL,128,64,10,360); add(arcAngle);
    }

    public boolean handleEvent( Event e ) {
        boolean result = super.handleEvent(e);
        if (e.target == x
        ||  e.target == y
        ||  e.target == width
        ||  e.target == height
        ||  e.target == startAngle
        ||  e.target == arcAngle
        ){
            paint( getGraphics() );
        }
        return result;
    }
    public void paint( Graphics g ) {
        g.clearRect( 0, 60, 300, 240 );
        g.fillArc(
            x.getValue(),
            y.getValue(),
            width.getValue(),
            height.getValue(),
            startAngle.getValue(),
            arcAngle.getValue()
        );
    }
}
