title: Why by default button mouse event handler consume an event?
body: <p>Thanks for the help on my last post(which is also my first post). I am new to the stackoverflow. I wish I had join the group earlier. People are extremely polite and helpful here. </p>
  
  <p>Anyway I have been working on understanding javafx event better. It may seem to be another simple or "stupid" question to some of you. <strong>Why by default button mouse event handler seems consume an event?</strong></p>
  
  <p>From <a href="http://docs.oracle.com/javafx/2/events/processing.htm#CEGJAAFD" rel="nofollow noreferrer">the oracle documents</a>, at the bottom of the page, it states that "Note that the default handlers for the JavaFX UI controls typically consume most of the input events." Is it a default handler attached to the button that I am not aware of? Why do I have to <em>EXPLICITLY</em> fire the event at the target node in order for it to bubble up the event dispatch chain? </p>
  
  <p>Again any response will be greatly appreciated! :)</p>
  
  <pre><code>public class MouseEventTest extends Application {
  
      @Override
      public void start(Stage primaryStage) {
          primaryStage.setTitle("Hello World");
  
          Group root = new Group();
  
          Scene scene = new Scene(root, 300, 250);
  
          Button btn = new Button();
          btn.setText("Hello World");
          btn.setPrefSize(100, 100);
  
  
          BorderPane layout = new BorderPane(btn);
          layout.setPrefSize(300, 250);
  
          root.getChildren().add(layout);
  
          //This is the event dispatch chain
          //primaryStage -&gt; scene -&gt; root -&gt; layout -&gt; btn  (capturing phrase)
          //btn -&gt; layout -&gt; root -&gt; scene -&gt; primaryStage  (bubbling phrase)
          btn.setOnMousePressed(e -&gt; { 
              System.out.println("btn mouse pressed...");
              //Why do I need to fire the mouse pressed event 
              //in order for the event to bubble up the chain?
              //It seems like by default that the button setOnMousePressed event hanlder
              //has consumed the event. Am I right?
              //layout.fireEvent(e); 
          });
  
          layout.setOnMousePressed(e -&gt; { System.out.println("layout mouse pressed...");});
          root.setOnMousePressed(e -&gt; { System.out.println("root mouse pressed...");});
          scene.setOnMousePressed(e -&gt; { System.out.println("scene mouse pressed...");}); 
  
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  </code></pre>