You're going to want to use java.applet.AudioClip to play your sounds. I find it's definitely the best way in Java2D. It's fairly simple. Basically you create the AudioClip and then call one of three methods.
AudioClip shot = new AudioClip("sounds/shot.wav");
shot.play(); //Plays the sound once
shot.stop(); //stops playing the sound
shot.loop(); //keeps playing the sound until stopped
And that should work fine, very simply. It sounds like you may be getting problems because you have not preloaded the sound. Do so by making a SoundManager class that holds all your sounds.
public class SoundManager
private AudioClip sounds;
public static final int SHOT_SND = 0;
public static final int DIE_SND = 1;
sounds = new AudioClip;
sounds[SHOT_SND] = new AudioClip("sounds/shot.wav");
sounds[DIE_SND] = new AudioClip("sounds/die.aif");
public void play(int sound)
public void stop(int sound)
public void loop(int sound)
Understand? Make sense?