title: Javafx: TableView change row color based on column value
body: <p>I have the following piece of code to update both the color of a column cell and its corresponding row:</p>
  
  <pre><code>    calltypel.setCellFactory(column -&gt; {
          return new TableCell&lt;CallLogs, String&gt;() {
              @Override
              protected void updateItem(String item, boolean empty) {
                  super.updateItem(item, empty);
  
                  setText(empty ? "" : getItem().toString());
                  setGraphic(null);
  
                  TableRow currentRow = getTableRow();
  
                  //This doesn't work
                  if(item.equals("a")){
                      item.setTextFill(Color.RED);
                      currentRow.setTextFill(Color.PINK);
                      }
                  else{
                      item.setTextFill(Color.GREEN);
                      currentRow.setTextFill(Color.BLUE);
                  }
  
              }
          };
      });
  </code></pre>
  
  <p>The code segment of 'if' condition doesn't work. I am unable to identify the correct references to objects and also what is the best way to do this.</p>
  
  <p>Thanks!</p>