title: How to listen to deselection of row in JavaFX tableview?
body: <p>I have a tableview with SelectionMode.MULTIPLE: </p>
  
  <pre><code>    table.setEditable(true);
      table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
  
      table.getSelectionModel().selectedItemProperty().addListener(
              (observable, oldValue, newValue) -&gt; {
                  table.getSelectionModel().getSelectedItems().forEach(System.out::println);
              });
  </code></pre>
  
  <p>Selecting rows works finde, but if a deselect a row again (by clicking ctrl+left-click) the listener doesn't react to that immediately. What I have to do to deselect a row is the following:  </p>
  
  <ol>
  <li>Select lets say <em>'Rob', 'Peter', 'Max' and 'John'</em> (Either by selecting them individualy with ctrl+left-click or all of them together by shift+left click)</li>
  <li>Unselect <em>'Peter'</em> by clicking ctrl+left-click (now this row has a weird blue border and the listener didn't detected the change)</li>
  <li>Deselect another row (Now this row has this weird border and 'Peter' is row looks normal)</li>
  <li>Reselect the previous row (Now the listener detects that I unselected <em>'Peter'</em>)<br>
  <img src="https://i.stack.imgur.com/atn84.png" alt="enter image description here"></li>
  </ol>