applet程序和html文件如下,不知道为什么,仅由一个 灰色区域
applet程序:
import java.awt.Graphics;
import javax.swing.*;
public class Add1 extends JApplet{
double sum;
public void init()
{String fname;
String sname;
double number1;
double number2;
fname=JOptionPane.showInputDialog("请输入第一个数");
sname=JOptionPane.showInputDialog("请输入第二个数");
number1=Double.parseDouble(fname);
number2=Double.parseDouble(sname);
sum=number1+number2;

}
public void paint(Graphics g) {
//super.paint(g);
g.drawRect(60, 80, 600, 600);
g.drawString("两个数的和是: "+sum, 200, 200); }
}
html语句如下:
<<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>    <body>
    <applet code="Add1.class" width="500" height="500" codebase=D:\eclipse\mywork\test1>
</applet>
    </body>
    
</html>