Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Playing sound using swing buttons

843802Mar 2 2007 — edited Mar 3 2007
HI,

I have a simple Swing app that displays a button on a frame. I have an action listener that listens for the button clicked event. I am trying to play a sound file (any type will do wav/mp3/MIDI etc.) when the button is pressed, but I can't figure out how to get the sound file to play, is there a simple and easy method call that i can put into the button clicked event listener to play a sound file?

I have tried to do this my self using various java books, and this and other websites,

Please help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2007
Added on Mar 2 2007
1 comment
263 views