title: JavaFX Unselect item on TreeView
body: <p>I have a TreeView, when I select an item, a tab opens with the corresponding information.
  But when I close the tab and try to open it, it does not appear because the item has already been selected. And I need to first select another, and then click on it again.</p>
  
  <p>I use this.</p>
  
  <pre><code>fileView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -&gt; {
      if (newValue == null)
          return;
      System.out.println("Selected File : " + newValue.getValue().getAbsolutePath());
      if (newValue.getValue().isFile()) {
          ...
      }
  });
  </code></pre>
  
  <p>I see 2 solutions to the problem.</p>
  
  <p>1) remove the selection label from the item </p>
  
  <p>2) replace the listener</p>
  
  <p>But I didn’t succeed.
  I will be glad to your solutions.
  Please provide a code snippet for example</p>
  
  <p>P.s. please do not lower my reputation, I'm really interested in my question</p>