我现在要播放固定文件夹下的音乐,只能使用getCodeBase()的路径
for(int i=0;i<templefile_list.length;i++)
m_sound[i] = getAudioClip( getCodeBase(),name[i]);//路径问题
怎么换成我想让它播放的路径呢?原代码如下:public class J_Ketoo extends JApplet implements ActionListener,ItemListener
{ File f = new File("D:\\Enterprise-SDK-Callisto-322-win32\\workspace\\J_Audio\\Audio\\music");
File[] templefile_list=f.listFiles();//templefile_list数据中包含目录下所有文件及目录
String name[] = new String[templefile_list.length];

private AudioClip  m_soundCurrent;
private AudioClip[] m_sound= new AudioClip[templefile_list.length];
private JButton m_buttonPlay, m_buttonLoop, m_buttonStop;
private JComboBox myList ;


public void init()
{
Container container = getContentPane();
container.setLayout(new FlowLayout());

m_buttonPlay = new JButton("Play");
m_buttonPlay.addActionListener( this );
container.add( m_buttonPlay );

m_buttonLoop = new JButton("Loop");
m_buttonLoop.addActionListener( this );
container.add( m_buttonLoop );

m_buttonStop = new JButton("Stop");
m_buttonStop.addActionListener( this );
container.add( m_buttonStop );

for(int i=0,j=0;i<templefile_list.length;i++)
name[i]= templefile_list[i].getName();

myList =new JComboBox(name);
myList.addItemListener( this );
container.add( myList);
for(int i=0;i<templefile_list.length;i++)
m_sound[i] = getAudioClip( getCodeBase(),name[i]);//路径问题
m_soundCurrent = m_sound[0];
}


public void stop()//Stop playing sound
{
m_soundCurrent.stop();
}

public void itemStateChanged(ItemEvent e) 
{ m_soundCurrent.stop();
m_soundCurrent =m_sound[myList.getSelectedIndex()];
}

public void actionPerformed(ActionEvent e)//End of mathod: actionPerformed
{
if( e.getSource()== m_buttonPlay )
m_soundCurrent.play();
else if( e.getSource() == m_buttonStop)
m_soundCurrent.stop();
else if( e.getSource() == m_buttonLoop)
m_soundCurrent.loop();
}}