The applet route should be fine (and is very straightforward). To avoid creating an Applet instance you can use the static newAudioClip method, and then call play() on the AudioClip created.
URL url = getClass().getResource("/foo/bar/sound.wav");
AudioClip clip = Applet.newAudioClip(url);
clip.play();
Here, the sound.wav file is bundled in the jar file in the foo/bar package that you create. A fully functional class (where the wav file is in the sounds package) would look like this:
package sounds;
import java.applet.Applet;
import java.applet.AudioClip;
public class PlaySound {
public void PlayBeep() {
AudioClip clip = Applet.newAudioClip(getClass().getResource("/sounds/beep3.wav"));
clip.play();
}
}
Here, the path is given as /sounds/ because when you extract the jar, you'll see that the wav file is located in the first folder in the jar, which is sounds.