• Post Reply Bookmark Topic Watch Topic
  • New Topic

java play sound  RSS feed

 
Jean Stu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im trying to play a sound when button is clicked. here is the following code


just wondering why it does load;

i do get the warning
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you were using a package beginning with com. or sun. They may (as the compiler has told you) be removed later.

More to the point: when you compiled that code, did it run? Did you hear anything?
 
Jean Stu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Maybe you were using a package beginning with com. or sun. They may (as the compiler has told you) be removed later.

More to the point: when you compiled that code, did it run? Did you hear anything?


when i have the full path it plays

 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved, then. In future I suggest not ignoring exceptions, which is what your posted code does and which is why you didn't know what the problem was. Your catch block should at least look like this:

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!