title: How to access a cell that is generated in a GridPane?
body: <p>I need to add a shape into a specific cell (middle centered one) in my GridPane. </p>
  
  <p>This is how cells (StackPane) are made in my GridPane:</p>
  
  <pre><code>private StackPane createCell() {
      StackPane cell = new StackPane();
      cell.getStyleClass().add("cell");
      return cell;
  }
  </code></pre>
  
  <p>I have tried to get the centered cell with this piece of method:</p>
  
  <pre><code>private Node getCenteredNodeGridPane(GridPane gridPane, int col, int row) {
      for (Node node : gridPane.getChildren()) {
          if (GridPane.getColumnIndex(node) == col/2 &amp;&amp; GridPane.getRowIndex(node) == row/2) {
              return node;
          }
      }
      return null;
  }
  </code></pre>
  
  <p>And then, get the node:</p>
  
  <pre><code>Node centeredNode = getCenteredNodeGridPane(grid, 20, 20);
  centeredNode ...... ??????
  </code></pre>
  
  <p>But i have no access to the actual StackPane of this node.
  I need something like, </p>
  
  <blockquote>
    <p>centeredNode.getChildren().add(shape);</p>
  </blockquote>