Parameter to Applet

import java.awt.Graphics;
import javax.swing.JApplet;
public class AppletParameter extends JApplet 
{
	String pvalue="Applet Initial Parameter Demo";
	@Override
	public void init() 
	{
		super.init();
		pvalue=getParameter("para1");
		repaint();
		}
	public void paint(Graphics gph)
	{
		gph.drawString(pvalue,50,50);
	}
}

Download

a1.html

<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
 <title>Insert title here</title>
 </head>
 <body>
 <applet code="appletdemo.AppletParameter" height=500 width=600 alt="Applet is not loded">
 <param name="para1" value="This is parameter to Applet from HTML">
 </applet>
 </body>
 </html>

Download

Applet in Swing

Simple Applet
Applet life cycle
Parameter in Applet
Manu bar in Applet


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code