Java Reference
In-Depth Information
request that the elevator come to his or her floor. On entering the elevator, the
passenger clicks a button on the right to request that it go to the specified floor.
F IGURE 18.21
The program simulates elevator operations.
VideoNote
*18.14
( Control a group of clocks ) Write a Java applet that displays three clocks in a
group, with control buttons to start and stop all of them, as shown in Figure 18.22.
Control a group of clocks
F IGURE 18.22
Three clocks run independently with individual control and group control.
Sections 18.10-18.12
*18.15 ( Enlarge and shrink an image ) Write an applet that will display a sequence of
images from a single image file in different sizes. Initially, the viewing area for
this image has a width of 300 and a height of 300. Your program should con-
tinuously shrink the viewing area by 1 in width and 1 in height until it reaches
a width of 50 and a height of 50. At that point, the viewing area should contin-
uously enlarge by 1 in width and 1 in height until it reaches a width of 300 and
a height of 300. The viewing area should shrink and enlarge (alternately) to
create animation for the single image.
***18.16
( Simulate a stock ticker ) Write a Java applet that displays a stock-index ticker
(see Figure 18.23). The stock-index information is passed from the <param>
tag in the HTML file. Each index has four parameters: Index Name (e.g., S&P
F IGURE 18.23
The program displays a stock-index ticker.
Search WWH ::




Custom Search