Java - Pasar parámetros a un Applet

 
Vista:

Pasar parámetros a un Applet

Publicado por Isaac (21 intervenciones) el 27/06/2007 18:33:09
Buenas, intento hacer un applet que coje parámetros mediante la etiqueta PARAM dentro del body del HTML donde se ejecuta el applet, todo ello lo ejecuto localmente y tengo en la misma carpeta al applet y el HTML.

El problema es que no me carga los parametros, os pongo aqui el trozo de codigo del applet q carga los datos:

String Ciclos;
String Jug1_Nombre;
String Jug1_x1;
String Jug1_y1;
String Jug1_x2;
String Jug1_y2;
..........................
..........................
..........................
String Jug22_Nombre;
String Jug22_x1;
String Jug22_y1;
String Jug22_x2;
String Jug22_y2;

for(i=1;i<=36;i++)
{
aux = getParameter("Jug"+i+"_Nombre");
if (aux != null)
{
try {
nombres[i-1] = aux;
}
catch (NumberFormatException e) {
}
}
aux="";
for(j=1;j<=ciclos;j++)
{
aux = getParameter("Jug"+i+"_x"+j);
if (aux != null)
{
try {
coordenadas[i-1][0][j-1] = Integer.parseInt(aux);
}
catch (NumberFormatException e) {
}
}
aux="";
}
}

Aqui os pongo un trozo del HTML:

<HTML>
<body>
<APPLET CODE=Animator.class WIDTH=500 HEIGHT=250>
<PARAM NAME=Ciclos VALUE="3">
<PARAM NAME=Jug1_Nombre VALUE="Pedro">
<PARAM NAME=Jug1_x1 VALUE="50">
<PARAM NAME=Jug1_y1 VALUE="25">
<PARAM NAME=Jug1_x2 VALUE="80">
<PARAM NAME=Jug1_y2 VALUE="30">
<PARAM NAME=Jug1_x3 VALUE="80">
<PARAM NAME=Jug1_y3 VALUE="30">
................................
................................
................................
<PARAM NAME=Jug22_Nombre VALUE="Juan">
<PARAM NAME=Jug22_x1 VALUE="50">
<PARAM NAME=Jug22_y1 VALUE="25">
<PARAM NAME=Jug22_x2 VALUE="80">
<PARAM NAME=Jug22_y2 VALUE="30">
<PARAM NAME=Jug22_x3 VALUE="80">
<PARAM NAME=Jug22_y3 VALUE="30">
</APPLET>
</body>
</HTML>

Espero me podais decir por que no funciona.

Saludos.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder