Java Applet Programming Question: Download Java Applet PDF

Can we pass parameters to an applet from HTML page to an applet? How?

Tweet Share WhatsApp

Answer:

We can pass parameters to an applet using <param> tag in the following way:

► <param name=”param1″ value=”value1″>
► <param name=”param2″ value=”value2″>

Access those parameters inside the applet is done by calling getParameter() method inside the applet. Note that getParameter() method returns String value corresponding to the parameter name.

Download Java Applet PDF Read All 26 Java Applet Questions
Previous QuestionNext Question
How do Applets differ from Applications?How do we read number information from my applets parameters, given that Applets getParameter() method returns a string?