这是我的MyApplet.java文件
import java.applet.*;
import java.awt.Graphics;
public class MyApplet{
public void paint(Graphics g)
{
g.drawString("shubh,...",20,20);
}
}
这是我的MyApplet.html文件
<html>
<applet code = "MyApplet.class" width="200" height="100">
</applet>
</html>
This is snapshot of cmd when i am trying to use applet viewer
生成Appletviewer但它是空白的。能帮我解决这个问题吗?
答案 0 :(得分:0)
你上课必须extends Applet
上课。
import java.applet.*;
import java.awt.Graphics;
public class MyApplet extends Applet{
public void paint(Graphics g)
{
g.drawString("shubh,...",20,20);
}
}