Java Reference
In-Depth Information
Display 17.19
A Simple Calculator
(part 4 of 4)
R
ESULTING
GUI
(After entering 2000.0 and clicking
+
)
R
ESULTING
GUI
(After entering 42)
R
ESULTING
GUI
(After clicking
+
)
Self-Test Exercises
39. In the GUI in Display 17.19 , why did we make the text fi eld
ioField
an
instance variable but did not make instance variables of any of the buttons
addButton
,
subtractButton
, or
resetButton
?
40. What would happen if the user running the GUI in Display 17.19 were to run
the GUI and simply click the addition button without typing anything into the
text fi eld?
(continued)