JApp.java
import java.applet.*;
import java.awt.*;
public class JApp extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.blue);
g.drawString("hello word!",50,25);
}
}japp.html
<html>
<applet code="JApp.class" width=300 height=200 codebase=".">
< /applet >
</html>
import java.applet.*;
import java.awt.*;
public class JApp extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.blue);
g.drawString("hello word!",50,25);
}
}japp.html
<html>
<applet code="JApp.class" width=300 height=200 codebase=".">
< /applet >
</html>
//<applet code="JApp.class" width=300 height=200 codebase=".">
//< /appet >
放到你的applet代码里的,,因为appletviewer只认识applet,在<think in java>中有写到,你翻书看看
<body>
<applet code="JApp.class" width=300 height=200 codebase=".">
< /applet >
</body>
</html>然后看看你的windows是不是sp2以上的,可能阻拦applet的跳出
把JApp.html代码中的< /applet > 中的空格去掉就可以了.改成</applet>
更改后的JApp.html代码如下:
<html>
<body>
<applet code="JApp.class" width=300 height=200 codebase=".">
</applet>
</body>
</html>
你试试吧.