//Addition Program
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class Lab2 extends Applet implements ActionListener {
        Label prompt;
        TextField input;
        int number;
        int sum;

        public void init()
        {
                prompt = new Label("Enter integer and press Enter");
                add (prompt);

                input = new TextField(10);
                add(input);

                sum = 0;

                input.addActionListener(this);
        }
        public void actionPerformed(ActionEvent e)
        {
                number = Integer.parseInt(e.getActionCommand());

                sum += number;
                input.setText("");
                showStatus(Integer.toString(sum));
        }
}
