Tuesday, March 10, 2009

When an user wants to send an int from HTML what does he needs to

Question :When an user wants to send an int from HTML what does he needs to
do? (Applets)

Answer :Either the user wants to send an int or a String, it will be the same. Here
are steps he might do to get an int
[html]
[applet code="Launch.class" archive="bak.jar" width=740 height=460]
[param name="mynum" value="098765"]
[/applet]
[/html]
And within the init() of your applet, Use the following line to get the value.
String mynum = getParameter("mynum");
int x = Integer.parseInt(mynum);

No comments: