Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Q&A

  1. Why is the Thread.sleep() method needed in the MathMan applet?

    The call to sleep () causes the thread controlling the program to pause for a set amount of time. The integer argument to the method indicates the number of milliseconds to delay before continuing the thread. This prevents the running together of different sounds when the mathematical expression is being read aloud. Experiment with different durations for the pause to see how it affects playback of the audio.

  2. Is there a reason that JApplet should be used instead of the Applet class for audio playback?

    The JApplet class inherits all its sound capabilities from the Applet class, so it doesn't matter which class you use when working with sound. However, all Java 2 applets use the JApplet class, so there's no reason to use a different class when working with applet-related features.

Share ThisShare This

Informit Network