Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parmeters from applet read into text area

Status
Not open for further replies.

cathiec

Programmer
Oct 21, 2003
139
IE
i have parameters in a html page and i read them into my java file using

for(i=1;i<=iMaxQuest;i++)
{
gQuestionsAcross = getParameter(&quot;A&quot; + i);
if(gQuestionsAcross == null) gQuestionsAcross = &quot;&quot;;

gQuestionsDown = getParameter(&quot;D&quot; + i);
if(gQuestionsDown == null)
gQuestionsDown = &quot;&quot;;

}

imaxQuest is a variable
gQuestionsAcross and gQuestionsDown are arrays of the parameters with the name A or D followed by a letter respectively.

when i try to access the array elements in order to print them into a text area the applet loads but instead of just printing the parameter values it keeps running and repeatly prints the values all the time, below is the code that i am using at the moment that does this. it seems as if the loop keeps running even after the max value of the counter has been reached. i have this loop in paint and the above code is in init.

for(int i=1;i<=gQuestionsAcross[].length-1;i++){
taQuestionArea.append(gQuestionsAcross);
}
 
method paint may run more than once, so put the code
Code:
for(int i=1;i<=gQuestionsAcross[].length-1;i++){
    taQuestionArea.append(gQuestionsAcross);
}
in the init
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top