要在ie中运行applet,class文件要放在哪里?

来源:百度知道 编辑:UC知道 时间:2024/06/27 08:11:24
我把class文件放在html同目录下,结果找不到class?
html源代码:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<applet
code="Applet1"
width=200
height=200>
</applet>
</body>
</html>

Applet1.java代码:

import java.awt.*;
import java.applet.*;

public class Applet1 extends Applet {
public void paint(Graphics g) {
g.drawString("First applet", 10, 10);
}
}

把编译好的class文件&html文件放在同目录下,打开html文件,却报class Applet1 not found的错误,Why?

你是JAVA的编程是吧,应该是外部编译后,嵌套在HTML中
你去网上看看JAVA的基础知识吧
JAVA小程序和JAVA运行程序是不同的,你再讲的清楚点

code=Applet1.java
你JAVA都不打,系统怎么会知道呢

Applet1.java
先编译这个文件
生成.class
然后在再html文件里
<applet code=\"Applet1.class\" width=200 height=200></applet>