I am making a Minesweeper clone, I am trying to create a new Board class when the user clicks on a mine thereby replacing the current board, but nothing happens when I create a new Board(). I tried to search online and the closest thing I can find is this How can I externally update a JavaFX scene?. I don't really understand the top answer and I need some guidance on a couple things;
Here is my Minesweeper clone on GitHub Gist.
EDIT: On user request, added some code snippets.
The main start method;
public void start(Stage primaryStage) {
primaryStage.setTitle("Minesweeper");
Control admin = new Control();
Scene sc = new Scene(admin.board);
primaryStage.setScene(sc);
primaryStage.sizeToScene();
primaryStage.setResizable(false);
primaryStage.show();
}
Where I create a new Board() in the Board class;
void display(Tile tile) {
String display = String.valueOf(tile.surMineNum);
if (tile.isMine) {
// HERE IS WHERE I CREATE A NEW BOARD()
admin.board = new Board(admin);
display = "M";
}
else if (tile.surMineNum < 1)
display = "";
tile.setText(display);
tile.setSelected(true);
}