Java Reference
In-Depth Information
**16.15
( Demonstrate Label properties ) Write a program to let the user dynamically
set the properties contentDisplay and graphicTextGap , as shown in
Figure 16.42b.
*16.16
( Use ComboBox and ListView ) Write a program that demonstrates selecting
items in a list. The program uses a combo box to specify a selection mode, as
shown in Figure  16.43a. When you select items, they are displayed in a label
below the list.
(b)
(c)
(a)
F IGURE 16.43
(a) You can choose single or multiple selection mode in a list. (b) The color changes in the text as you
adjust the scroll bars. (c) The program simulates a running fan.
Sections 16.6-16.8
**16.17
( Use ScrollBar and Slider ) Write a program that uses scroll bars or slid-
ers to select the color for a text, as shown in Figure 16.43b. Four horizontal
scroll bars are used for selecting the colors: red, green, blue, and opacity
percentages.
**16.18
( Simulation: a running fan ) Rewrite Programming Exercise 15.28 to add a slider
to control the speed of the fan, as shown in Figure 16.43c.
**16.19
( Control a group of fans ) Write a program that displays three fans in a group,
with control buttons to start and stop all of them, as shown in Figure 16.44.
F IGURE 16.44
The program runs and controls a group of fans.
*16.20
( Count-up stopwatch ) Write a program that simulates a stopwatch, as shown
in Figure  16.45a. When the user clicks the Start button, the button's label is
changed to Pause , as shown in Figure 16.45b. When the user clicks the Pause
 
Search WWH ::




Custom Search