I'm trying to play sound in Java but it doesn't work and I got error message. Here is my Code
public class PlaySoundClip extends JFrame {
public PlaySoundClip() {
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  this.setTitle("Test Sound Clip");
  this.setSize(300, 200);
  this.setVisible(true);
  try {
     URL url = this.getClass().getClassLoader().getResource("click.wav");
     AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);//Line 27
     // Get a sound clip resource.
     Clip clip = AudioSystem.getClip();
     // Open audio clip and load samples from the audio input stream.
     clip.open(audioIn);
     clip.start();
     clip.loop(Clip.LOOP_CONTINUOUSLY);  // repeat forever
  } catch (UnsupportedAudioFileException e) {
     e.printStackTrace();
  } catch (IOException e) {
     e.printStackTrace();
  } catch (LineUnavailableException e) {
     e.printStackTrace();
  }
}
public static void main(String[] args) {
  new PlaySoundClip();//Line 44
 }
}
And I get this error message then I'm not here any sound! How to fix this problem?
Exception in thread "main" java.lang.NullPointerException   
    at com.sun.media.sound.StandardMidiFileReader.getSequence(StandardMidiFileReader.java:205)   
    at javax.sound.midi.MidiSystem.getSequence(MidiSystem.java:836)   
    at com.sun.media.sound.SoftMidiAudioFileReader.getAudioInputStream(SoftMidiAudioFileReader.java:174)   
    at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1145)   
    at playsoundclip.PlaySoundClip.<init>(PlaySoundClip.java:27)   
    at playsoundclip.PlaySoundClip.main(PlaySoundClip.java:44)      
Reference from Playing Sound.
 
     
     
    