Author: Tansf
代码如下
//------getParameter.Java
import java.awt.*;
import java.applet.*;
public class getParameter extends Applet{
private String title;
public void paint(Graphics g){
title=getParameter("title");
g.drawString ("Hello World!",20,20);
g.drawString ("getParameter: "+title,20,50);
}
}
//----------getParameter.htm
<Html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>tansf</title>
</head>
<body>
<applet code="getParameter.class" width="210" height="118">
<param name="title" value="tansf">
</applet>
</body>
</html>
以上代码从htm文件中获取title的值