import java.applet.*; import javax.swing.*; import javax.sound.sampled.*; import java.awt.event.*; public class play extends JApplet { //vőtab soundi faili public void init() { String filename = getParameter("clip");//votab faili clip = getAudioClip(getDocumentBase(), filename);//teeb klipi button = new JButton(play); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals(play)) { clip.loop(); button.setText(stop); } else { clip.stop(); button.setText(play); } } } ); getContentPane().add(button); } AudioClip clip; JButton button; final String play = "play"; final String stop = "stop"; }