TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Saturday, 11 April 2020

Parameter In Applet | Passing Parameter To Applets In Java

    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(). 

passing parameter in applet | using parameter in java applet


Fig: Parameter In Applet 


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>  

No comments:

Post a Comment