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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -