Media Section Index | Page 8
How can I control the volume of the sounds I play from my Java program?
Java provides no support for increasing or decreasing the volume of the user's computer. Your users would need to use the controls native to their computers to change the volume.
How can I signal the user audibly with a beep?
The Toolkit class contains a beep() method for this purpose:
Toolkit.getDefaultToolkit().beep();
or, if in a Component subclass:
getToolkit().beep();
more
Can I use the Java2D capabilities with the 1.1 Java runtime environment?
The short answer is no. The libraries are part of the standard Java 2 platform release (starting with version 1.2). Since they modify core classes in the java.awt.* libraries, you can not pull the...more
How do I play sound in an application?
Starting with the 1.2 release of Java, you can use the newAudioClip() method of Applet to get an AudioClip to play in an application.
File file = new File("bark.wav");
AudioClip clip = Applet.new...more