miércoles, 28 de noviembre de 2012


Trabajo

package newpackage;

import javax.swing.JLabel;

/**
 *
 * @author w7
 */
public class NewJFrame extends javax.swing.JFrame {
    private final int[][] numeros;
    private int j;
    private int i;
    private int[][] numero;

    /**
     * Creates new form NewJFrame
     */
    public NewJFrame() {
        initComponents();
       
        JLabel[][] campos=new JLabel[4][4];
        for(int i=0;i<4;i++){
        for(int j=0;j<4;j++){
           
        campos[i][j]=new JLabel("");
        campos[i][j].setBounds((80*i)+10,(40*j)+10,80,40);
        this.add(campos[i][j]);
        campos[i][j].setVisible(true);
        }
        }
  Integer C=1;
      for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
     if(i==0||i==2)
     numeros[i][j]=1;
     
    }
     
      else{
    numero[i][j]=0;
}

    private void initComponents() {

    }
}}
}
   
     
      for(int i=0;i<4;i++){
       for(int j=0;j<4;j++){
           campos[i][j].setText(numeros[i][j].toString());
       }}
     
    }

No hay comentarios:

Publicar un comentario