コード例 #1
0
 /**
  * Gets the Node at a given location in the GridPane
  *
  * @param row the row (y-coordinate) where to get the Node
  * @param column the column (x-coordinate) where to get the Node
  * @param gridPane the GridPane to get a Node from
  * @return the Node at that given location from the GridPane
  */
 private Node getNodeFromIndex(int row, int column, GridPane gridPane) {
   Node result = null;
   ObservableList<Node> childrens = gridPane.getChildren();
   for (Node node : childrens) {
     if (gridPane.getRowIndex(node) == row && gridPane.getColumnIndex(node) == column) {
       result = node;
       break;
     }
   }
   return result;
 }