source file name: AppletParamDemo.java
/*
<html>
<body>
<applet code=AppletParamDemo.class width=550 height=300 >
<param name="college" value="DBJ College" > // input value
</applet>
<body>
<html>
*/
import java.awt.*;
import java.applet.*;
public class AppletParamDemo extends Applet
{
String name="";
Font f1;
public void init()
{
name=getParameter("college");
f1=new Font("Courier", Font.BOLD,20);
}
public void paint(Graphics g)
{
g.setFont(f1);
g.drawString("your college name: "+name,50,100);
}
}
output:
0 Comments
Post a Comment