Sound Applet refuses to show in any browser
Okay I'm sorry if this has been posted elsewhere but I haven't been able to find it and have been stuck for a long time.
The problem is I cannot get my applet to work right in any browser
I'm using jpadpro to write and compile my code. Once its compiled. I used the inbuilt applet tester in the program which works absoluetly fine. I then try to stick it into a html file and load it in my installed browsers (mozilla and ie) and it refuses to load the applet. :(
Here is my code:
Code:
import java.applet.*;
import java.awt.event.*;
import java.awt.*;
import java.net.*;
import javax.swing.*;
public class SoundApplet extends JApplet implements ActionListener
{
URL sound; AudioClip music;
public void init()
{
try
{
sound = new URL("file:music.wav");
music = JApplet.newAudioClip(sound);
music.loop();
}
catch(MalformedURLException error){}
Container contentArea = getContentPane();
JButton button = new JButton("Click To Stop Sound");
button.addActionListener(this);
contentArea.add(button);
}
public void actionPerformed(ActionEvent event)
{music.stop();}
}
Anyhow I'd be very thankful for any help :confused: