This applet was constructed using the GridBagLayout and Event classes from java.awt.

    To implement the calculator, first I created the layout with the text display and calculator buttons.  For the implementation of the calculations, the logic flows as follows.

First, when the applet is initialized, the textfield has the null string displayed.  As the user enters the first operand, the first digit is appended to the null string, thus displaying the entered digit.  If the first operand has more than one digit, the second digit is appended to the string containing the first digit and so on.

At this time, the first operand should be in the textfield and the user shall indicate which operation is to be performed.  Upon clicking an operation, the textfield is saved to the accumulator, the indicated operation is noted, and the textfield is cleared for the second operand.

The user then enters the second operand in the same manner as the first.  Now, then user would click the "equals" button to see the result of the desired calculation.  Upon clicking the "equals" button, the contents of the textfield is saved, the first operand is retrieved, the operation is retrieved, and the desired calculation is performed.  The result is then sent to the textfield.

To begin the next calculation, the user must press the "clear" button, else the newly entered digits will be appended to the result of the preceding calculation.