Question

I have created a simple desktop application (MCQ simulator) in Java Swing. Now I want a simple sound to be generated (may be MP3 file residing on disk) when user presses a button (continue or submit button).

What are the suitable built-in class/methods for the same?

Was it helpful?

Solution

Java Sound provides support for sound in Java apps. Note there is no SPI for MP3 by default, but one can be added easily. See the linked page for details.

For a much simpler sound, look to Toolkit.beep().

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top