Hello all I'm to return a particular JButton to then later setText on it. Here is a snippet of the code:
JButton[][] tiles = new JButton[4][4];
for (int i=0; i<4; i++) {
for (int j=0; j<4; j++){
tiles[i][j] = new JButton();
}
}
I would basically like to return this JButton using an accessor method.
public JButton getJButton(int i, int j) {
return JButton[i][j];
}
This is my current idea however that is currently returning null, any ideas on a solution?
Many thanks.