title: How can I stop a MouseEvent in JavaFX?
body: <p>(Sorry for my poor English)</p>
  
  <p>I don't know how I can stop a Mouse Event in JavaFX. </p>
  
  <p>This code generates a small image into a large rectangle when I press a button and then pressed the large rectangle, but if I press again the big rectangle is rebuilt a new image.</p>
  
  <p>I dont want to generate a new image, how Can I do that?</p>
  
  <pre><code>        button.setOnAction((ActionEvent t) -&gt; {
          rectangle.setOnMouseClicked((MouseEvent me) -&gt; {
  
              Rectangle asdf = new Rectangle(48, 48, Color.TRANSPARENT);
  
              StackPane imageContainer = new StackPane();
              ImageView image = new ImageView("firefox-icono-8422-48.png");
              imageContainer.getChildren().addAll(asdf, image);
              imageContainer.setTranslateX(me.getX());
              imageContainer.setTranslateY(me.getY());
  
              enableDragging(imageContainer);
  
              rootGroup.getChildren().add(imageContainer);
              myList2.add(imageContainer);
  
          });
      });
  </code></pre>
  
  <p>Thanks</p>
  
  <p>PS: t.consume() and me.consume(); don't anything.</p>