import java.applet.*;
import java.awt.*;
import java.net.*;


public class SoundandImage extends Applet{

  private ImageIcon myImage;
  private AudioClip mySound;
  
    public void init() {

        myImage = getImage(getCodeBase(), "animpequins.gif");
        mySound = getAudioClip (getCodeBase(),"dedodedo.wav");
        
    }

    public void start() {
        
        mySound.loop();
    }


    public void paint(Graphics g) {

        g.drawImage ( myImage, 0, 0, this);
    }


    public void stop() {

        mySound.stop();
    }

    
}


/*  
This example uses the AudioClip class which has 3 methods, loop(), play(), stop().  Thus, we have more control than when we use the Applet classes play() method.
*/