为什么这个程序运行不成功其他的图片声音文件都有........ImgButton.java文件:
/**
*本案例是一个用java applet实现页面响应鼠标事件的例子.
*实现了鼠标移入,移出,点击事件的响应的功能.
**/
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
//页面响应鼠标事件
public class ImgButton extends Applet implements MouseListener
{
private int width,height;    //定义图象按钮的宽度和高度
private Image offI,img1,img2,img3; //定义Image图象
private Graphics offG; //定义Graphics图象
private MediaTracker imageTracker; //定义图象跟踪器
private boolean isMouseEnter=false,isPress=false; //定义鼠标状态变量
private Color ButtonColor=Color.yellow,lightC,darkC; //定义按钮颜色
private URL url; //定义超连接变量
private AudioClip soundA,soundB; //定义声音文件变量,以便读取声音文件
private String param; //定义参数变量,以便从HTML文件获取参数
public void init()  //Applet的初始化方法
{
param=new String();
//从HTML文件获取声音文件参数
param=getParameter("soundA");
if(param==null)
param="midiA.mid";
soundA=getAudioClip(getDocumentBase(),param);
param=getParameter("soundB");
if(param==null)
param="midiB.mid";
soundB=getAudioClip(getDocumentBase(),param);
//从HTML文件获取图形按钮尺寸
width=getSize().width;
height=getSize().height;
//从HTML文件获取超连接参数
param=getParameter("URL");
try
{
url=new URL(param);
}catch(MalformedURLException e) {
}
//创建图象并加载到图象跟踪器
offI=createImage(width,height);
offG=offI.getGraphics();
imageTracker=new MediaTracker(this);
param=getParameter("Images1");
img1=getImage(getCodeBase(),param);
imageTracker.addImage(img1,0);
param=getParameter("Images2");
img2=getImage(getCodeBase(),param);
imageTracker.addImage(img2,0);
param=getParameter("Images3");
img3=getImage(getCodeBase(),param);
imageTracker.addImage(img3,0);
try
{
imageTracker.waitForID(0);
}catch(InterruptedException e) {
}
//安装鼠标事件监听器
addMouseListener(this);
}
public void start() //Applet的启动方法
{
offG.drawImage(img1,0,0,width,height,this);
repaint();
}
public abstract void mouseClicked(MouseEvent e); //点击鼠标事件
{

}
public void mousePressed(MouseEvent e) //点住鼠标不放产生的事件
{
offG.drawImage(img3,0,0,width,height,this);
repaint(); //重画图象
soundA.play(); //播放声音文件
getAppletContext().showDocument(url);   //连接到指定网页
}
public void mouseEntered(MouseEvent e) //鼠标移入事件
{
offG.drawImage(img2,0,0,width,height,this);
repaint();
}
public void mouseExited(MouseEvent e) //鼠标移出事件
{
offG.drawImage(img1,0,0,width,height,this);
repaint();
}
public void paint(Graphics g) //画出图象
{
g.drawImage(offI,0,0,width,height,this);
}
}
ImgButton.html文件:
<applet code="ImgButton.class" width=275 height=275>
<param name=soundA value="midiA.mid">
<param name=soundB value="midiB.mid">
<param name=Images1 value="button1.gif">
<param name=Images2 value="button2.gif">
<param name=Images3 value="button3.gif">
<param name=URL value=http://www.qq.com>
</applet>