开发者

Playing sound when showing popup in Swing?

I have a frame which pops up whenever an event occurs.

Whenever that frame pops up, I want开发者_Go百科 a sound to be played.

How can I do that in Swing?


A very simple solution is using Toolkit.getDefaultToolkit().beep();


Check this question in this same site: How can I play sound in Java?


Subclass JDialog or similar and on the constructor/setVisible method of the derived class play a sound with one of the fore mentioned methods.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜