Answer the question
In order to leave comments, you need to log in
JavaFx how to uninstall Node?
I created a GridPane panel, hung a listener on it, when I click the mouse, I calculate the cell address, create a new object like Ellipse, ImageView, and put it in this cell. How can I dynamically delete and replace these objects ? Is it possible to clear a specific GridPane cell? Please include code if possible, thanks in advance.
Answer the question
In order to leave comments, you need to log in
If there is a reference to a Node, then it can be removed gridPane.getChildren().remove(node);
If there is no link, then only redraw the entire table:
gridPane.setGridLinesVisible(false);
gridPane.getColumnConstraints().clear();
gridPane.getRowConstraints().clear();
gridPane.getChildren().clear();
gridPane.setGridLinesVisible(true);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question