Java Reference
In-Depth Information
FIGURE 12-32 Figure for Programming Exercise 19
20. Convert the Java application program of Exercise 19 into an applet.
21. Create a GUI that prompts the user to enter a measurement in inches and
displays the corresponding measurement in centimeters in a text area.
Accept input from the user, display results in the text area, until the user
presses an exit button or the program has processed 15 numbers. Before
processing the 16th number, clear the text area. A sample addition to the
text area might be 2.00 inches = 5.08 centimeters .
22. Enhance the GUI of Programming Exercise 21 by omitting duplicate
entries. Also add a scroll bar to the text area so that more than 15 lines
can be viewed.
23. Enhance the GUI of Programming Exercises 22 by adding two buttons: one
with the label Inches to Centimeters and the other with the label
Centimeters to Inches . When the user enters a value and presses one
of the two buttons, the appropriate calculation is performed and the results
are appended to the text area.
Search WWH ::




Custom Search