你的虚拟路径是什么,如果是跟目录,可能会有问题,webshpere里面如果你的虚拟路径是跟目录,连图片都不解吸。
你加个虚拟路径试试

解决方案 »

  1.   

    先谢谢你们。我的声音文件和html、applet程序在同一目录下,在applet程序中是用AudioClip clip = getAudioClip(getDocumentBase(), "music.wav");来加载声音文件的。
      

  2.   

    applet程序如下:import java.applet.*;
    import javax.swing.*;
    import java.awt.event.*;public class PlayIt extends JApplet
    {
    public void init()
    {
    //Get the sound clip
    clip = getAudioClip(getDocumentBase(), "music.wav"); //Create the clip

    //Rest of the applet initialization...
    myButton = new JButton(play); myButton.addActionListener(new ActionListener()
    {
    public void actionPerformed(ActionEvent e)
    {

    if(e.getActionCommand().equals(play))
    {
    clip.loop();
    myButton.setText(stop);
    }
    else
    {
    clip.stop();
    myButton.setText(play);
    } }
    }); getContentPane().add(myButton);
    }
    AudioClip clip;
    JButton myButton;
    final String play = "PLAY";
    final String stop = "STOP";
    }
      

  3.   

    已解决!windows把music.wav的文件名改成music.WAV了,致使applet程序找不到该文件。