Ramirez Albarran Omar escom ipn 6SCV2

Site hosted by Angelfire.com: Build your free website today!

Archivo 2

import java.awt.*;
import java.applet.*;

public class EjemApplet2 extends Applet
{
Label prompt;
TextField input;
int numero;
int suma;
public void init()
{
prompt =new Label ("Teclee un entero y pulse enter:");
input = new TextField (10);
add(prompt);
add(input);
suma=0;
}
public boolean action (Event e, Object o)
{
numero = Integer.parseInt(o.toString());
input.setText(" ");
suma = suma + numero;
showStatus(Integer.toString(suma));
return(true);
}
}


<HTML>
<HEAD><TITLE>MI APPLET</TITLE>
</HEAD>
<BODY>
<APPLET CODEBASE= "file://c:/javac/bin/"
CODE="EjemApplet2.class",WIDTH=600, HEIGHT=400>
</APPLET>
</BODY>
</HTML>