Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Button with sound  RSS feed

 
Harold Lauder
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hello everyone. I'm trying to combine different codes from Java Head First. The code should show the window with a button and if you press button the sound should play. But I have an error



I think this is because method works only with parameters ActionEvent's



How I can fix it?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The button does not have any play() method The SimpleGuiB class does.
Instead of button.play(); use this.play();
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!