import java.awt.*;
import java.applet.*;
import java.lang.*;
public class ParamPass extends Applet
{
String str;
int n;
public void init()
{
str=getParameter("string");
n=Integer.parseInt(getParameter("n"));
}
public void paint(Graphics g)
{
g.drawString(n+" & "+str+" have been passed through HTML",10,10);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
g.drawString(str,j*20,i*20);
}
}
}
}
/*
<html>
<body>
<applet code=ParamPass.class width=500 height=500>
<param name="string" value="=">
<param name="n" value="10">
</applet>
</body>
</html>
*/
import java.applet.*;
import java.lang.*;
public class ParamPass extends Applet
{
String str;
int n;
public void init()
{
str=getParameter("string");
n=Integer.parseInt(getParameter("n"));
}
public void paint(Graphics g)
{
g.drawString(n+" & "+str+" have been passed through HTML",10,10);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
g.drawString(str,j*20,i*20);
}
}
}
}
/*
<html>
<body>
<applet code=ParamPass.class width=500 height=500>
<param name="string" value="=">
<param name="n" value="10">
</applet>
</body>
</html>
*/
No comments :
Post a Comment