//first java Applet import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Add extends Applet implements ActionListener { Label prompt; //Message tp porompt user TextField input; //input values entered here int number,sum; public void init() { prompt = new Label("Enter an 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 = sum + number; input.setText(""); showStatus(Integer.toString(sum)); } }