Multiple Buttons

Objective: GUIs and listeners.
When working with numbers and text, remember that the argument passed to the setText() method must be a string.   
Similarly, remember that the return type passed out of the setText() method is always a string.   If you want to do arithmetic on the return type, you'll need to parse it, either to an int or to a double.
Some static (class) methods in the Math class that you should know:

Math function

Example command

Absolute value

x = Math.abs(y);

Square root

x = Math.sqrt(y);


x = y * y;

Cube root

x = Math.pow(y, 1.0/3.0);

Set x equal to 1

x = Math.pow(y, 1/3);        //due to integer division, 1/3 à 0

Raise to a power

x = Math.pow(2, 10);         //Recall that 210 = 1024

Sine, y in degrees

x = Math.sin(y * Math.PI / 180.0);

Cosine, y in degrees

x = Math.cos(Math.toRadians(y));

Filename  Create an appropriate driver.  Make sure to add a panel object of type Panel02.  Size recommendations for the frame are included as part of the on-line demo.
Filename  Reverse engineer the panel based on the on-line demo.  Notice that there is no text box, but that there is only one label.  Since you have four buttons, you will have to have four listeners.  To make the Quit button work, check the System class in Sun’s Java API for some hints.