IE无法加载Applet小程序?
//Html文件如下:
<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR= "000000 ">
<CENTER>
<APPLET
codebase= ". "
code = "MyFirstApplet.class "
width = "300 "
height = "150 "
>
</APPLET>
</CENTER>
</BODY>
</HTML>
//java如下:
//MyFirstApplet.java
import java.awt.*;
import javax.swing.*;
public class MyFirstApplet extends JApplet
{
public void init()
{
JPanel panel=(JPanel)getContentPane();
JLabel label = new JLabel( "我的第一个Java Applet! ",
SwingConstants.CENTER);
panel.add(label);
}
}
用appletviewer MyFirstApplet.java命令是好的,java路径是好的,HTML页和JAVA程序在同一路径下,就是打开HTML页是无法加载小程序 "load:class MyFirstApplet no found "
------解决方案--------------------哈哈,是这样的,你重新安装一下JDK1.5。因为JDK要在IE中安装一个plugs-in,所以当你运行的时候,IE因为找不到那个插件所以就找不到那个类了。
------解决方案--------------------重装过java webstart