title: How do I make a mouse click event be acknowledged by a TreeItem in a TreeView?
body: <p>The fxml file is as follows (headers omitted):</p>
  
  <pre><code>&lt;BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
      minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0"
      xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
      fx:id="pane"
      fx:controller="com.github.parboiled1.grappa.debugger.mainwindow.MainWindowUi"&gt;
      &lt;top&gt;
          &lt;MenuBar BorderPane.alignment="CENTER"&gt;
              &lt;Menu mnemonicParsing="false" text="File"&gt;
                  &lt;MenuItem fx:id="loadInput" mnemonicParsing="false"
                      text="Load file" onAction="#loadFileEvent"/&gt;
                  &lt;MenuItem fx:id="parse" mnemonicParsing="false"
                      text="Parse" onAction="#parseEvent"/&gt;
                  &lt;MenuItem fx:id="closeButton" mnemonicParsing="false"
                      text="Close" onAction="#closeWindowEvent"/&gt;
              &lt;/Menu&gt;
          &lt;/MenuBar&gt;
      &lt;/top&gt;
      &lt;center&gt;
          &lt;SplitPane dividerPositions="0.5" prefHeight="160.0" prefWidth="200.0"
              BorderPane.alignment="CENTER"&gt;
              &lt;SplitPane dividerPositions="0.5" orientation="VERTICAL"&gt;
                  &lt;TreeView fx:id="traceTree" prefHeight="200.0"
                      prefWidth="200.0" editable="false"/&gt;
                  &lt;TextArea fx:id="traceDetail" prefHeight="200.0"
                      prefWidth="200.0"/&gt;
              &lt;/SplitPane&gt;
              &lt;TextArea fx:id="inputText" prefHeight="200.0" prefWidth="200.0"/&gt;
          &lt;/SplitPane&gt;
      &lt;/center&gt;
  &lt;/BorderPane&gt;
  </code></pre>
  
  <p>I can set the root of the <code>TreeView</code> with no problem at all. The tree is updated with no problem.</p>
  
  <p>The problem I have is that I cannot manage to have an event fired on a given item in the view. I tried and added a <code>onMouseClicked</code> event with a simple System.out.println() and I can see the event being fired, whichever item I click in the tree. But I cannot manage to get the item which has been clicked in the view at all.</p>
  
  <p>How do I do that?</p>