import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Sounds extends JApplet {
    
    AudioClip clip;

    public void init() {
	//Image image = getImage(getCodeBase(), "cube.gif");
	//ImageIcon icon = new ImageIcon(image);
       	clip = getAudioClip(getCodeBase(), "bark.au");
	//JButton playButton = new JButton("Play", icon);
	JButton playButton = new JButton("Play");
 	JButton loopButton = new JButton("Loop");
	JButton stopButton = new JButton("Stop");
   	Container pane = getContentPane();
	pane.setLayout(new GridLayout(3, 1));
	pane.add(playButton);
	pane.add(loopButton);
	pane.add(stopButton);
	playButton.addActionListener(new ActionListener()
	{
	    public void actionPerformed(ActionEvent ae)
	    {
		clip.play();
	    }
	});
	loopButton.addActionListener(new ActionListener()
	{
	    public void actionPerformed(ActionEvent ae)
	    {
		clip.loop();
	    }
	});
	stopButton.addActionListener(new ActionListener()
	{
	    public void actionPerformed(ActionEvent ae)
	    {
		clip.stop();
	    }
	});
	setSize(200, 150);
    }

}

