Java Reference
In-Depth Information
11
.
What Swing component creates a check box? What event is generated when a check
box is selected or deselected?
JList
displays a list of items from which the user can select. True or False?
the first selected item?
False?
17
.
Add a check box to the file comparer developed in
Try This 15-1
that has the follow-
ing text: Show position of mismatch. When this box is checked, have the program
display the location of the first point in the files at which a mismatch occurs.
ted.
19.
Bonus challenge: Convert the Help class developed in
Try This 4-1
into a Swing-
based GUI program. Display the keywords (
for
,
while
,
switch
, and so on) in a
JList
.
When the user selects one, display the keyword's syntax. To display multiple lines of
text within a label, you can use HTML. When doing so, you must begin the text with
the sequence
<html>
. When this is done, the text is automatically formatted as de-
scribed by the markup. In addition to other benefits, using HTML enables you to cre-
ate labels that span two or more lines. For example, this creates a label that displays
two lines of text, with the string "Top" over the string "Bottom".
No answer is shown for this exercise. You have reached the point where you are
ready to apply your Java skills on your own!