• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to have sound in a JOptionPane message?  RSS feed

 
Frank Ramirez
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody
I'm working on an assignment. I have everything I need but I want to give it an extra. My program gives the results in a JOptionPane window and I want it to make a sound (a simple sound, nothing complex) when the window pops up. Is there a way to do it? Can you guys guide me or give me a link to the info of how it can be done?
Thanks in advance
 
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
Check out the Toolkit class API for a method which will let you beep (hint).
Remember, JOptionPane.showXXXDialog are all holding calls. If you do not take this into consideration, you will not hear the beep until your dialog closes.

UI related questions would be better suited on the Swing forum.
CarefullyChooseOneForum

Moving thread.
 
Frank Ramirez
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thank you. I'll check it out.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!