Cannot play wav sounds in java
I have a simple program that will play the wav files when executed. But the sound doesnt play. Here is the code
import javax.swing.*;
import java.awt.*;
import java.net.*;
import java.beans.*;
import java.io.*;
import java.applet.*;
import java.awt.event.*;
publicclass testextends JPanel
{
publicstaticvoid main(String args [])
{
try{
URL dance =new URL("file:res/hallelujah.wav");
AudioClip danceClip = Applet.newAudioClip(dance);
danceClip.play();
}catch (Exception e)
{
e.printStackTrace();
}
}
Can anyone the error? Thanks

