Write a program using Applet For configuring Applets by passing parameters.
Program Code:
import java.applet.*;
import java.awt.Graphics;
/* <applet code="AppletParamDemo.class" width=300 height=100>
<param name=place value="Gulbarga"> <param name=college value="Govt Polytechnic">
</applet> */
public class AppletParamDemo extends Applet
{
String p,c;
public void init()
{
p=getParameter("place");
c=getParameter("college");
}
public void paint(Graphics g)
{
g.drawString(c,80,20);
g.drawString(p,100,40);
}
Post A Comment:
0 comments: