简单的音频播放JApplet 不能播放 有人能帮我看一下吗(附源码了)
源码import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
public class Music extends JApplet implements ActionListener{
private AudioClip[] audioClips = {Applet.newAudioClip(this.getClass().getResource("music/知多少.wma")),Applet.newAudioClip(this.getClass().getResource("music/scarborough fair.mp3"))};
private JButton jbtplay = new JButton("play");
private int currentIndex = 0;
public void init(){
JPanel p = new JPanel();
p.add(jbtplay);
getContentPane().add(p,BorderLayout.CENTER);
jbtplay.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
audioClips[0].play();
System.out.println("####");
}
}