I am coding a minesweeper game. The buttons should display the numbers 0,1 or 2 when clicked to display how many mines are adjacent. I recently changed the layout to gridlayout and since then all I get when I click on a button is '...' with the exception of the discovery of a mine which changes the button to the bomb gif. 

Can anyone tell me how to get the numbers back on click?

Here is the code to create the button Array:

```
    JPanel gridPanel = new JPanel(new GridLayout(boardsize, boardsize));
    buttons = new JButton[boardsize][boardsize];
    mineBoard = new int[9][9];
    for (int a = 0; a < boardsize; a++) 
        for (int b = 0; b < boardsize; b++) {
            buttons[a][b] = new JButton("");
            gridPanel.add(buttons[a][b]);
            buttons[a][b].addMouseListener(new MouseListener(a,b));
            setx(a);
            sety(b);
            settried(false);
            setmine(false);
    }   
    contentPane.add(gridPanel, BorderLayout.CENTER);

```

When the user clicks a button:

```
  // This method takes in an x and y value and defines what should happen when the user clicks there. 
public void click(int row, int col) {
    if(mineBoard[row][col] == Mine) {

        buttons[row][col].setIcon( new ImageIcon( "images/bomb.gif" ) );
        lose();
    } else {
        score += 1;
        updatescore();
        buttons[row][col].setText("" + numAdjMines(mineBoard, row, col));
        mineBoard[row][col] = UncoveredEmpty;
        buttons[row][col].setText(Character.toString(getUserChar(mineBoard[row][col])));
        if(numAdjMines(mineBoard, row, col) == Empty) {
            for(int dr = -1; dr <= 1; dr ++) {
                for(int dc = -1; dc <= 1; dc++) {
                    if(row+dr >= 1 && row+dr < 10 &&
                    col+dc >= 1 && col+dc < 10) {
                        if(mineBoard[row+dr][col+dc] == Empty) {
                            click(row+dr,col+dc);
                        }
                    }
                }
            }
        }
    }
}

```

MouseLister Class:

```
 //ACTION WHEN USER CLICKS ON A BUTTON
private class MouseListener extends MouseAdapter {
    private int x = 0;
    private int y = 0;

    public MouseListener(int row, int col) {
        this.x = row;
        int i = 0;
        this.y = col;
    }

    public void mouseClicked(MouseEvent e) {
        if(e.getButton() == MouseEvent.BUTTON1) {
            if((mineBoard[x][y] == Empty) && (Game.this.gamegoing == true)) {
                Game.this.click(x, y);
            } else if(mineBoard[x][y] == Mine) {
                buttons[x][y].setIcon( new ImageIcon( "images/bomb.gif" ) );
                Game.this.lose();

            }} else if(e.getButton() == MouseEvent.BUTTON3) {
            Game.this.buttons[x][y].setText("F");
        }
    }

}

```