Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/10/2005, 08:56
abieliseo
 
Fecha de Ingreso: febrero-2005
Mensajes: 125
Antigüedad: 19 años, 3 meses
Puntos: 0
Código PHP:
public class bidi extends Applet implements ActionListener
{
private 
int arr[][]=new int [5][2];
private 
TextField cuadro;
private 
Button boto;
private 
int x,y,k;
private 
int aux=0;

public 
void init(){
cuadro=new TextField (2);
add(cuadro);
boto=new Button ("GUARDA VALOR");
add(boto);
boto.addActionListener(this);
}
public 
void paint(Graphics g){

for(
x=0x<5x++){
for(
y=0y<2y++){
aux=aux +arr[x][y];
}
}

g.drawString(""aux,100,50);

}
public 
void actionPerformed(ActionEvent e){
arr[k][k]=Integer.parseInt(cuadro.getText());
k++;
repaint ();

}