Java Reference
In-Depth Information
F IGURE 18.27
This applet lets the user select image files, an audio file, and the animation
speed.
**18.23
( Simulation: raise flag and play anthem ) Create an applet that displays a flag
rising up, as shown in Figure 16.1b-d. As the national flag rises, play the
national anthem. (You may use a flag image and anthem audio file from
Listing 18.13.)
Comprehensive
***18.24
( Game: bean-machine animation ) Write an applet that enhances the bean
machine animation in Programming Exercise 16.22. The applet lets you set the
number of slots, as shown in Figure 18.28. Click Start to start or restart the ani-
mation and click Stop to stop.
(a)
(b)
(c)
F IGURE 18.28
The applet controls a bean-machine animation.
**18.25
( Game: guess birthdays ) Listing 3.3, GuessBirthday.java, gives a program for
guessing a birthday. Create an applet for guessing birthdays as shown in
Figure 18.29. The applet prompts the user to check whether the date is in any
of the five sets. The date is displayed in the text field upon clicking the Guess
Birthday button.
***18.26
( Game: math quiz ) Listing 3.1, AdditionQuiz.java, and Listing 3.4, Subtrac-
tionQuiz.java, generate and grade math quizzes. Write an applet that allows
Search WWH ::




Custom Search