Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javafx 2 : How do I delete a row or column in Gridpane

If I want to add a row of text fields programatically in JavaFx, i can simply use the gridpane add method

This adds a set of text fields to row 1.

for (int i = 0; i < Fields.size(); i++) {
   gridpane.add(new TextField(), i, 1);
}

Similarly, How do I delete a row?. I dont find a suitable method to delete a row/column conveeniently in JavaFX.

like image 422
Natty Avatar asked Apr 11 '14 02:04

Natty


1 Answers

There's no directly equivalent method. To remove nodes, just use gridpane.getChildren().remove(...); or gridpane.getChildren().removeAll(...); and pass in the nodes you want to remove from the pane.

like image 63
James_D Avatar answered Oct 14 '22 17:10

James_D