File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Adding a sound file to a java applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Adding a sound file to a java applet" Watch "Adding a sound file to a java applet" New topic

Adding a sound file to a java applet

Bernard Clark

Joined: Jan 20, 2012
Posts: 1
I have a simple animation applet: bouncing balls, which compiled and ran without problems. I wanted to add sound to the applet so that when ball hit walls of applet container a sound file was played. When i added sound capability to the applet, it compiled with out problems but crashed when i ran it. Here's the program...

Paul Clapham

Joined: Oct 14, 2005
Posts: 18115

Crashed? The best thing to do in that case is to start by looking at the stack trace. You'll find that in the Java console. It should tell you what line of the code threw an exception, and also what the exception was.
I agree. Here's the link:
subject: Adding a sound file to a java applet
Similar Threads
Not drawing the Button?
First time with applets
Double buffering / drawChars / flickering
Not able to change Background color of a component
Not to show the ellipse?