import java.awt.*;  /* JDK 1.0 only */
import java.applet.*;

public class Thermo10 extends Applet {

  private int temp = 22;
  private Label tempDisplay;
  private Button plusButton, minusButton;

  public void init () {
    setLayout (new FlowLayout() );
    tempDisplay = new Label("" + temp, Label.CENTER);
    minusButton = new Button(" -1");
    plusButton = new Button("+1");
    add(minusButton);
    add(tempDisplay);
    add(plusButton);
    show();
  }

  public boolean handleEvent (Event e) {
    if (e.id == Event.ACTION_EVENT) {
      if (e.target == minusButton) {
        temp--;
      }
      else if (e.target == plusButton) {
        temp++;
      }
      tempDisplay.setText("" + temp);
    }
    return super.handleEvent(e);
  }
}

