title: JavaFX does not repaint when removing an object drawn on top of another object
body: <p>In the code below, the green rectangle is not removed on mouse click. However, if you resize the stage after the mouse click, the scene is repainted and the green rect vanishes.</p>
  
  <p>If you set the green rectangle's size to 150/150, then some of it is immediately on top of the pane, and it vanishes immediately on mouse click.</p>
  
  <ul>
  <li>Is this a JavaFX bug, or am I overlooking something?</li>
  <li>How can I make the rectangle disappear on mouse click?</li>
  </ul>
  
  <p>My environment: Windows 7 / Java 1.8.0 64-Bit Server VM build 25.0-b70.</p>
  
  <pre><code>package xschach.client;
  
  import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.layout.Pane;
  import javafx.scene.paint.Color;
  import javafx.scene.shape.Rectangle;
  import javafx.stage.Stage;
  
  public class Main3 extends Application {
      public static void main(String[] args) {
          Application.launch(Main3.class.getName());
      }
  
      public Main3() {}
  
      @Override
      public void start(Stage stage) throws Exception {
          Pane pane = new Pane();
          Rectangle rect = new Rectangle(10, 10, 200, 200);
          pane.getChildren().add(rect);
          stage.setScene(new Scene(pane, 300, 300));
          stage.show();
  
          Rectangle rect2 = new Rectangle(100, 100, 50, 50);
          rect2.setFill(Color.GREEN);
          pane.getChildren().add(rect2);
  
          pane.setOnMouseClicked(event -&gt; pane.getChildren().remove(rect2));
      }
  }
  </code></pre>