You are on page 1of 2

New: JAXB | Junit

Javatpoint
Home Core Java Servlet

Development | Training | SEO Promotion | Consultancy


SSS IT (Powered by Javatpoint). Visit www.sssit.org for more details.
JSP Struts2 Mail API Hibernate Spring Android Quiz Projects Interview Q

Advertise Us | Ask Question | forum | login| 0120-4256464, +91-9990449

Comment

Forum

Basics of Java OOPs Concepts String Handling Exception Handling Nested Classes Multithreading Synchronization I/O Serialization Networking AWT Event Handling Swing LayoutManager Applet Applet Basics Graphics in Applet Displaying image in Applet Animation in Applet EventHandling in Applet JApplet class Painting in Applet Digital Clock in Applet Analog Clock in Applet Parameter in Applet Applet Communication Reflection API Collection JDBC Java New Features RMI Internationalization

<< prev

next>>

Parameter in Applet
We can get any information from the HTML file as a parameter. For this purpose, Applet class provides a method named getParameter(). Syntax:

public String getParameter(String parameterName)

Example of using parameter in Applet:

import java.applet.Applet; import java.awt.Graphics; public class UseParam extends Applet{ public void paint(Graphics g){ String str=getParameter("msg"); g.drawString(str,50, 50); } }

myapplet.html

<html> <body> <applet code="UseParam.class" width="300" height="300"> <param name="msg" value="Welcome to applet"> </applet> </body> </html>

download this example.

prev

next>>

Tweet

Like

16k

Like the www.javatpoint.com on facebook / google+ / twitter / subscribe to get latest updates

Sitemap

Core Java

Servlet

JSP

Struts2

Hibernate

Spring

Android

Interview Questions

javatpoint.com is developed to provide easy and point to point learning and training in detail. Examples might be simplified to improve reading and basic und

Tutorials and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. If there is any mistake, please mail

sonoojaiswal1987@gmail.com or sonoojaiswal@javatpoint.com. We provide assurance of 90% interview questions. While using this site, you agree to hav accepted our terms of use and privacy policy. 2011-2013 Javatpoint. All Rights Reserved.

You might also like