I'm new in java and here is what i'm trying to do:
1. Make a crossword grid / layout with 2D array of JButton.
2. Put number on the top left of JButton and color the JButton with black and white (maybe with paint component)
3. Make small window that have TextField in it that show up when the white colored JButton being clicked where people can input the answer there, click the "ok" button and get the input text to show up in the JButton. if the black colored being clicked, it will show up message box that say "You can't input".
4. Make question that show up in other window. So there will be two window, the one that show the crossowrd and the one that show the question. Or maybe the question is in the same window with the TextField. Which is the easy/simplest way..
5. To check whether the input and the answer is same if it's true it will show message box "Your guess is right!", and the input text will show up in the JButton with black color and can't be clicked anymore. But if false, it will show message button "Your guess is wrong!", and the input text will show up in the JButton with re color and can be clicked again untill the input is the right one.

Any help would be appreciated..,
Thanks..

I tried to put the number but the order of array is wrong or upside down. How to solve this??
Code:
final int ROWS = 12;

final int COLS = 12;

final static int topLeftNum[][]= {
	{-1, 1, 0, 2, 0, 0, 3, -1, 4, 0, 5, 0},
    {6, 0, 0, 0, -1, -1, 0, -1, -1, -1, 0, -1},
    {-1, 0, -1, 0, -1, 7, 0, 0, 8, -1, 0, -1},
    {9, 0, 0, 0, 10, -1, -1, -1, 11, 0, 0, -1},
    {0, -1, -1, 12, 0, 0, 13, -1, 0, -1, -1, -1},
    {0, -1, 14, -1, 0, -1, 0, -1, 15, 0, 0, 16},
    {17, 0, 0, 18, 0, -1, 19, 20, 0, -1, -1, 0},
    {0, -1, 0, 0, -1, 21, 0, 0, 0, -1, -1, 0},
    {22, 23, 0, 0, -1, 0, -1, 0, -1,24, 0, 0},
    {-1, 0, -1, 25, 0, 0, -1, 0, -1, 0, -1, -1},
    {26, 0, 0, -1, -1, 0, -1, 27, 0, 0, 0, -1},
    {-1, -1, -1, -1, -1, 0, -1, 0, -1, 0, -1, -1}
    };
 
public Lat1() {


this.getContentPane().setLayout(new GridLayout(ROWS, COLS));

for (int j=0; j<COLS; j++) {
	for (int i=0; i<ROWS; i++)	{
this.getContentPane().add(new Box(i, //the boxes index

(topLeftNum[j][i] < 0) ? Color.BLACK : Color.WHITE, //pick the color

topLeftNum[j][i], //the topleft number

(char)(65+i), //the char inside

this), //the action listener for the button

i); //the index to place it on the container

}
}

this.pack();

this.setVisible(true);

}