java - In JavaFx, how to remove a specific node from a gridpane with the coordinate of it? -


if know specific coordinate of node trying remove, let's "col:3, row: 4", how can remove node in column 3 , row 4? there built-in method can use in java?

you need remove node (child) layout (gridpane)

public node removenodebyrowcolumnindex(final int row,final int column,gridpane gridpane) {  observablelist<node> childrens = gridpane.getchildren(); for(node node : childrens) {     if(node instanceof imageview && gridpane.getrowindex(node) == row && gridpane.getcolumnindex(node) == column) {         imageview imageview=imageview(node); // use want remove         gridpane.getchildren().remove(imageview);         break;     }   }     } 

Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -