JMF is usually the way to go when wanting to play music and/or video in Java
For MP3s -as in the code above- I'd agree, but for other formats (like AIFF, WAV and MIDI) the
Java Sound API might be a better choice, as it is part of the JRE. I'd even go as far as saying that unless the point of the application is to play MP3s specifically, it may be preferable to convert the audio files to a format that Java Sound can handle, thus avoiding having to deal with JMF. (Which, although functional, hasn't been updated in years, partly relies on native code, is not part of the JRE etc.)