title: How to get an auto-sorting TableView?
body: <p>I have a TableView with a list of items (Transaction) and want it to sort, so that all positive values are above the negative ones. This is the only requirement.</p>
  
  <p>What I have until now:</p>
  
  <pre><code>expensesTableView.sortPolicyProperty().set(
      new Callback&lt;TableView&lt;Transaction&gt;, Boolean&gt;() {
      @Override
      public Boolean call(TableView&lt;Transaction&gt; param) {
          Comparator&lt;Transaction&gt; c = (a, b) -&gt; {
              if (a.getValue().contains("-") ^ b.getValue().contains("-")) { //getValue() returns a String
                  return a.getValue().contains("-") ? 1 : -1;
              }
              return 0;
          };
          FXCollections.sort(expensesTableView.getItems(), c);
          return true;
      };
  });
  </code></pre>
  
  <p>This wasn't my idea, I found this on the net, so don't ask if it looks like a strange way to achieve that. The real problem is, that the table doesn't sort on its own when a new item is added/edited/deleted. I need to click the header 3 times and then it does what I want.
  How can I have a list that is always sorted correctly?</p>
  
  <p>I tried adding a ChangeListener and sort on change. But besides that this is an ugly way to do that, it didn't even work... I'm at the end of ideas.</p>