title: Clean gridPane in JavaFX and maintain the Grid line
body: <p>I'm trying to make a simple game (it is a school work) in JavaFX and I am trying to clear the panel with the board, and then just repaint it. I have tried a lot of methods, and this one is the only one I found that removes all the pieces of the board (visually) without creating a visual bug that shows a piece that has already been deleted but is still shown.</p>
  
  <p>So I declare the <code>gridPane</code> like this:</p>
  
  <pre><code>private GridPane gridPecas;
  
  @Override
  public void start(Stage primaryStage)
  {
      gridPecas = new GridPane();
      gridPecas.setGridLinesVisible(true);
  
      paintBoard();
  
      // rest of the code to create and paint the Stage
   }
  
   private void paintBoard()
   {
      gridPecas.getChildren().clear();
      // Code to fill the board with ImageView and Images of the pieces
   }
  </code></pre>
  
  <p>The problem with this method, is that when the "gridPecas.getChildren().clear();" is called I just loose the grid lines from the <code>GridPanel</code>.</p>
  
  <p>How can I solve this problem?</p>