You are here: Home / Topics / Program to use getParameter() method to access width and height of applet in Java

Program to use getParameter() method to access width and height of applet in Java

Filed under: Java on 2023-09-20 06:40:03

// Program to use getParameter() method to access width 
// and height of applet.

import java.awt.*;
import java.applet.Applet;

/*
<applet code="AppletTest2a.class" width="300" height="100">
</applet>
*/

public class AppletTest2a  extends  Applet 
{
public void init() 
{
 System.out.println("width =" + getParameter("width"));
 System.out.println("height=" + getParameter("height"));
}
}


Output:

D:\Java>appletviewer AppletTest2a.java

About Author:
S
Shyam Dubey     View Profile
If you are good in any field. Just share your knowledge with others.