i have tried to create an applet to just play sound, no buttons or controls. The sound should start playing as soon as the applet starts. But the sound doesnt come. There r no compile-time or run-time error, i've even created the correct policy for Audio Permissions but still no sound ? Heres my code...

import java.applet.*;  
import java.net.*; 


<applet code="Audio2" width="300" height="300">

public class Audio2 extends Applet 

    public void init() 
            URL url1 = new URL("file://C:/jdk1.5/bin/Cool.wav"); 
            AudioClip cli = Applet.newAudioClip(url1); 
        catch (MalformedURLException ex)  

What am i doing wrong ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.