FileDocCategorySizeDatePackage
PhilAnimator.javaAPI DocExample2008Tue Dec 12 18:57:46 GMT 2000None

PhilAnimator

public class PhilAnimator extends Applet

Fields Summary
private Button
stopStartButton
Scrollbar
grabDelaySlider
private Label
label
private FramedArea
framedArea
Constructors Summary
Methods Summary
public booleanhandleEvent(java.awt.Event e)

        if (e.target == stopStartButton) {
            if (stopStartButton.getLabel().equals("stop/reset")) {
                framedArea.stopButton();
                stopStartButton.setLabel("start");
            } else if (stopStartButton.getLabel().equals("start")) {
                framedArea.startButton();
                stopStartButton.setLabel("stop/reset");
            }
        } else if (e.target == grabDelaySlider) {
            label.setText(String.valueOf(100*grabDelaySlider.getValue()) + 
				         " milliseconds");
        }
        return false;
    
public voidinit()


       
        GridBagLayout gridBag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();

        setLayout(gridBag);

        framedArea = new FramedArea(this);
        c.fill = GridBagConstraints.BOTH;
        c.weighty = 1.0;
        c.gridwidth = GridBagConstraints.REMAINDER; //end row
        gridBag.setConstraints(framedArea, c);
        add(framedArea);

        c.fill = GridBagConstraints.HORIZONTAL;
        c.weightx = 1.0;
        c.weighty = 0.0;
        gridBag.setConstraints(stopStartButton, c);
        add(stopStartButton);


        c.gridwidth = GridBagConstraints.RELATIVE; //don't end row
        c.weightx = 1.0;
        c.weighty = 0.0;
        gridBag.setConstraints(grabDelaySlider, c);
        add(grabDelaySlider);

        c.weightx = 0.0;
        c.gridwidth = GridBagConstraints.REMAINDER; //end row
        gridBag.setConstraints(label, c);
        add(label);

        validate();