title: JavaFx 2 - TableView , return selected item
body: <p>I would like to get the selected item as String from a TableView, but it returns the whole path.</p>
  
  <p><img src="https://i.stack.imgur.com/lIPTh.png" alt="enter image description here"> </p>
  
  <p>In the picture above, when I click to select the cell, I would like to get</p>
  
  <pre><code>Indicator selected is: = Shannon Entropy;
  </code></pre>
  
  <p>while I get</p>
  
  <pre><code>Indicator selected is: taindicators.indicatorsmaingui.IndicatorsGuiController$Indicators@2dafcbf
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>tableviewIndicators.setOnMousePressed(new EventHandler&lt;MouseEvent&gt;() {
          @Override 
          public void handle(MouseEvent event) {
              if (event.isPrimaryButtonDown() &amp;&amp; event.getClickCount() == 1) {
  
                  String indSelected = tableviewIndicators.getSelectionModel().getSelectedItem().toString();
                  System.out.println("Indicator selected is: " + indSelected);                   
              }
          }
      });
  }
  </code></pre>
  
  <p>What's wrong with this code?</p>
  
  <p>Thanks.</p>