import java.awt.*;
import java.applet.*;

public class SampleCheckboxes1
extends      Applet
{
    TextField output;
    Checkbox  box1;
    Checkbox  box2;
    Checkbox  box3;

    public void init() {
        setLayout( new GridLayout( 4, 1 ) );
        output = new TextField("balloon",40);     add(output);
        box1    = new Checkbox( "Big");           add(box1);
        box2    = new Checkbox( "Red");           add(box2);
        box3    = new Checkbox( "Shiny");         add(box3);
        output.setEditable(false);
    }

    public boolean action( Event e, Object what ) {
	boolean result = super.action( e, what );
        if (e.target == box1
        ||  e.target == box2
        ||  e.target == box3
        ){
            String s1 = (box1.getState() ? "big "   : "");
            String s2 = (box2.getState() ? "red "   : "");
            String s3 = (box3.getState() ? "shiny " : "");
            String s  = s1 + s2 + s3 + "balloon";
            output.setText(s);
        }
	return result;
    }
}
