title: Deleting clickable panes in JavaFX (In controller)
body: <p>Im setting up a game and I have tried numerous ways to attempt to get rid of these panes that are only needed once per "turn". I need a way to inverse a function that creates multiple panes in every cell. I've tried this:</p>
  
  <pre><code>      for (int i = 0 ; i &lt; numCols ; i++) {
                  for (int j = 0; j &lt; numRows; j++) {
                      addPane(i, j);
                  }
              }
          }
  
  
          private void addPane(int colIndex, int rowIndex) {
              Pane pane = new Pane();
              pane.setOnMouseEntered(e -&gt; {
                  System.out.printf("Mouse enetered cell [%d, %d]%n", colIndex, rowIndex);
              });
              grid.add(pane, colIndex, rowIndex);
          }
  private void removePane(int colIndex, int rowIndex) {
              Pane pane2 = new Pane();
              pane.getChildren().remove(pane2);
          }
  
        for (int i = 0 ; i &lt; numCols ; i++) {
                  for (int j = 0; j &lt; numRows; j++) {
                      removePane(i, j);
                  }
              }
          }
  </code></pre>
  
  <p>I expect the panes to all be removed upon using the removePane function but nothing changes. The panes are still in each cell.</p>