Java Reference
In-Depth Information
3. Click the equal button.
The answer, 9, displays (Figure 6-41). Because the variable named first was
changed to false, the equal button displays the result and then resets the
flag variables, so that the calculator is ready for the next calculation.
answer
displays
equal
button
FIGURE 6-41
You may continue to test other possible scenarios by entering other calcula-
tions using different operators and multiple operands to test the application
further. Each time you click the equal button, the result of the calculation should
display.
Testing the Menu System
Testing the menu system of the Calculator application will involve clicking
the Clear, Cut, and Paste commands on the Edit menu, as well as the About
Calculator command on the About menu and the Exit command on the File
menu. The following steps test the menu system of the Calculator application.
To Test the Menu System
1. With the Calculator Application
window still open, click the 5 but-
ton, click the 7 button, and then
click the 9 button on the keypad.
The number 579 displays in the
TextField (Figure 6-42).
clicked
buttons
display
FIGURE 6-42
 
Search WWH ::




Custom Search