I'm making the game Minesweeper for a project in class, and I've settled upon making a GridPane
, and then adding a Matrix of ImageView
objects, i.e.
GridPane grid = new GridPane();
ImageView[][] gridButtons = new ImageView[16][16];
for(int i = 0;i<16;i++)
{
for(int k = 0;k<16;k++)
{
gridButtons[i][k] = coveredView;
grid.getChildren().add(gridButtons[i][k]);
}
}
However when I try to run it, I get this:
Children: duplicate children added: parent = Grid hgap=0.0, vgap=0.0, alignment=TOP_LEFT
Any help is appreciated, thanks in advance!