package co.uniandes.KM.logicPuzzles.UI;

import javax.swing.*;

import java.awt.event.*;

public class Tablero extends JFrame implements ActionListener {

    static final long serialVersionUID = 1L;
    private JLabel    nombreHorizontal, nombreVertical;
    private JButton   fila1A, fila2A, fila3A, fila4A, fila1B, fila2B, fila3B,
            fila4B, fila1C, fila2C, fila3C, fila4C;

    public Tablero() {
        setLayout(null);
        int posX = 30;
        String etiquetas[] = { "a", "b", "c", "d", "1", "2", "3", "4", "w", "x", "y", "z" };
        String botones[] = { "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", "a16" };
        JButton filas[] = { fila1A, fila2A, fila3A, fila4A, fila1B, fila2B, fila3B, fila4B, fila1C, fila2C, fila3C, fila4C };

        /* para construir cuadrante a */
        for (int ia = 0; ia < 4; ia++) {
            nombreHorizontal = new JLabel(etiquetas[ia]);
            nombreHorizontal.setBounds(25 + posX, 20, 200, 30);
            add(nombreHorizontal);

            nombreVertical = new JLabel(etiquetas[ia + 8]);
            nombreVertical.setBounds(10, posX + 25, 200, 30);
            add(nombreVertical);

            for (int ja = 0; ja < 4; ja++) {
                filas[ja] = new JButton(botones[ia]);
                filas[ja].setBounds(posX, 50 + (50 * ja), 50, 50);
                add(filas[ja]);
            }

            posX += 50;
        }

        /* para construir cuadrante b */
        for (int ib = 4; ib < 8; ib++) {
            nombreHorizontal = new JLabel(etiquetas[ib]);
            nombreHorizontal.setBounds(posX + 35, 20, 200, 30);
            add(nombreHorizontal);

            for (int jb = 4; jb < 8; jb++) {
                filas[jb] = new JButton(botones[jb]);
                filas[jb].setBounds(posX + 10, (50 * (jb - 3)), 50, 50);
                add(filas[jb]);
            }
            posX += 50;

        }

        /* para construir cuadrante c */
        for (int ic = 8; ic < 12; ic++) {
            nombreHorizontal = new JLabel(etiquetas[ic - 4]);
            nombreHorizontal.setBounds(10, posX - 160, 200, 30);
            add(nombreHorizontal);

            for (int jc = 8; jc < 12; jc++) {
                filas[jc] = new JButton(botones[jc]);
                filas[jc].setBounds(posX - 400, 10 + (50 * (jc - 3)), 50, 50);
                add(filas[jc]);
            }
            posX += 50;

        }

    }

    public static void main(String[] args) {
        Tablero miTablero = new Tablero();
        miTablero.setBounds(10, 10, 960, 580);
        miTablero.setVisible(true);
        miTablero.setResizable(false);

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        // TODO Auto-generated method stub

    }

}

@@ -147,17 +147,21 @@
 tener %7B%0A
+    
 %0A
-
     stat
@@ -403,16 +403,37 @@
 Tablero(
+String%5B%5D%5B%5D dimensions
 ) %7B%0A    
@@ -476,16 +476,25 @@
 X = 30;%0A
+        %0A
         
@@ -518,71 +518,255 @@
 %5D = 
-%7B %22a%22, %22b%22, %22c%22, %22d%22, %221%22, %222%22, %223%22, %224%22, %22w%22, %22x%22, %22y%22, %22z%22 %7D;
+new String%5B12%5D;%0A        %0A        for (int i = 0; i %3C dimensions.length; i++) %7B%0A            for (int j = 0; j %3C dimensions%5Bi%5D.length-1; j++) %7B%0A                etiquetas%5Bj+(i*dimensions.length)%5D = dimensions%5Bi%5D%5Bj+1%5D;%0A            %7D%0A        %7D%0A        
 %0A   
@@ -2732,87 +2732,56 @@
     
-Tablero miTablero = new Tablero();%0A        miTablero.setBounds(10, 10, 960, 580
+DimensionDataInput dDI = new DimensionDataInput(
 );%0A 
@@ -2783,33 +2783,27 @@
 ();%0A        
-miTablero
+dDI
 .setVisible(
@@ -2812,47 +2812,8 @@
 ue);
-%0A        miTablero.setResizable(false);
 %0A%0A  

Set main board class to get input from DimensionDataInput