一、将音乐播放的类放入包里
二、把文件目录确定下来
三、在MyPanel的构造器中启动AePlayWave的线程
附AePlayWave代码:
public class AePlayWave extends Thread { private String filename; public AePlayWave(String wavfile) { filename = wavfile; } public void run() { File soundFile = new File(filename); AudioInputStream audioInputStream = null; try { audioInputStream = AudioSystem.getAudioInputStream(soundFile); } catch (Exception e1) { e1.printStackTrace(); return; } Aud