Find the getParameter method
is the value in the applet?
What does the related getParameterInfo method do?
change the color ?
The Integer wrapper class
What package is it in ( applet) ? is the AnAppletWithParms?
Find the parseInt method
Is in the object for the java class?
What are the other wrapper classes analogous to Integer for other types
Applets are invoked as client-side applications running under a user's local JVM. The classes themselves are downloaded from the same server that the webpage that specified the applet (due to sandbox restrictions).
The applet parameters (if any) are sub-elements of the object tag on the webpage that defined the applet. The applet can then use the getParameter method to obtain their values. What the applet does with parameter values is the applet's decision.
Your code example does not include a "package" statement, which means that the applet class is defined in Java's default package (which isn't recommended, incidentally).
What don't you understand about the Integer wrapper class? It's one of the core Java classes that comes as part of the JVM.
Tim Holloway wrote:Applets are invoked as client-side applications running under a user's local JVM. The classes themselves are downloaded from the same server that the webpage that specified the applet (due to sandbox restrictions).
The applet parameters (if any) are sub-elements of the object tag on the webpage that defined the applet. The applet can then use the getParameter method to obtain their values. What the applet does with parameter values is the applet's decision.
Your code example does not include a "package" statement, which means that the applet class is defined in Java's default package (which isn't recommended, incidentally).
What don't you understand about the Integer wrapper class? It's one of the core Java classes that comes as part of the JVM.
thank you so much by the way, what is this mean
8) n = Integer.parseInt(parmString);
he single parameter: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at AnAppletWithParms.init(AnAppletWithParms.java:8)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
do i need created or find the JVM?
It means that the variable "parmString" is null and therefore can't be parsed into an integer value. Which, based on your code, means that the HTML from which the applet is run doesn't have an applet parameter named "number".
Paul Clapham wrote:It means that the variable "parmString" is null and therefore can't be parsed into an integer value. Which, based on your code, means that the HTML from which the applet is run doesn't have an applet parameter named "number".
I see,so i need a "number" for the parameter
meaning i need to add a number like 1 or 0 for the applet parameter?
Not exactly. Your question implies you already have an applet parameter in your HTML. If you do, then apparently it isn't named "number". To make your code run you need an applet parameter named "number". And yes, its value does have to be an integer value, since you have code which assumes it is.
Paul Clapham wrote:Not exactly. Your question implies you already have an applet parameter in your HTML. If you do, then apparently it isn't named "number". To make your code run you need an applet parameter named "number". And yes, its value does have to be an integer value, since you have code which assumes it is.
Ok isn't inside the java file rather the HTML File.
this what found on the html:
Post by:autobot
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
a bit of art, as a gift, the permaculture playing cards