Creating a class to play sounds.
I have a main GUI JFrame class and i want to play .wav sounds when a button is pressed. I've configured everything in the GUI and now i just need to make a sound class which plays a song, located in the file which the jar file will be in. How would i go about doing this?
My main class is called Bluemoon.
The sound class i've started is called PlaySound.
Re: Creating a class to play sounds.
You could copy the code out of your post on this thread:
http://www.javaprogrammingforums.com...html#post53241
Re: Creating a class to play sounds.
You told me it was wrong D: I'm not good at sounds in java.....
Re: Creating a class to play sounds.
The code plays sounds OK. The problem is the way the code is inside of an inner class.
Re: Creating a class to play sounds.
How would i fix that..? Yes. I am a noob.
Re: Creating a class to play sounds.
This project is past your knowledge. You need to learn more about how to write classes and methods.
Save this project for later. Go back and work on the basics.
Re: Creating a class to play sounds.
I know how to do this.. Its sound that confuses me.
Re: Creating a class to play sounds.
The code you posted works. Repackage it in another method and it should work there.
Why do you want to muck around with code that works. Leave it alone.
Re: Creating a class to play sounds.