title: TableView -fx-text-fill on rows
body: <p>Acording to <a href="https://stackoverflow.com/questions/18390152/javafx-tableview-cannot-override-fx-text-fill">this very similar question</a>, either high specificity or the <code>!important</code> tag should be used to change very 'hidden' selectors.</p>
  
  <p>However, I cannot seem to change the <code>-fx-text-fill</code> of a <code>TableRow</code>.</p>
  
  <p>I'd rather solve this issue than using <code>setTextFill</code> in the row factory.</p>
  
  <hr>
  
  <p><b>SSCCE</b></p>
  
  <p>The <code>tableviewtester.css</code> goes next to the <code>TableViewTester</code> class, and contains:</p>
  
  <pre><code>.myrow {
      -fx-selection-bar-text: red;
      -fx-text-fill: red; 
  }
  </code></pre>
  
  <hr>
  
  <p>Notice the <code>-fx-selection-bar-text</code> working.</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.beans.property.SimpleStringProperty;
  import javafx.beans.value.ObservableValue;
  import javafx.collections.FXCollections;
  import javafx.scene.Scene;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableColumn.CellDataFeatures;
  import javafx.scene.control.TableRow;
  import javafx.scene.control.TableView;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  import javafx.util.Callback;
  
  /**
   * 
   * @author ggrec
   *
   */
  public class TableViewTester extends Application
  {
  
      // ==================== 3. Static Methods ====================
  
      public static void main(final String[] args)
      {
          launch(args);
      }
  
  
      // ==================== 4. Constructors ====================
  
      @Override
      public void start(final Stage primaryStage) throws Exception
      {
          final Scene scene = new Scene(createContents());
          scene.getStylesheets().add(this.getClass().getResource("tableviewtester.css").toExternalForm());
  
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
  
      // ==================== 5. Creators ====================
  
      private StackPane createContents()
      {
          final StackPane pane = new StackPane();
  
          final TableView&lt;String&gt; table = new TableView&lt;&gt;();
          table.setRowFactory(new TableRowFactory());
  
          final TableColumn&lt;String, String&gt; column = new TableColumn&lt;&gt;("Color");
          column.setCellValueFactory(new TableCellValueFactory());
          column.prefWidthProperty().setValue(300);
  
          // Add Columns
          table.getColumns().setAll(FXCollections.observableArrayList(column));
  
          // Add Items
          table.setItems(FXCollections.observableArrayList("Green", "Red", "Blue"));
  
          pane.getChildren().setAll(table);
  
          return pane;
      }
  
  
      // =======================================================
      //           19. Inline Classes 
      // =======================================================
  
      private class TableCellValueFactory implements Callback&lt;CellDataFeatures&lt;String, String&gt;, ObservableValue&lt;String&gt;&gt;
      {
          @Override
          public ObservableValue&lt;String&gt; call(final CellDataFeatures&lt;String, String&gt; cellWrapper)
          {
              return new SimpleStringProperty(cellWrapper.getValue());
          }
      }
  
      private class TableRowFactory implements Callback&lt;TableView&lt;String&gt;, TableRow&lt;String&gt;&gt;
      {
          @Override
          public TableRow&lt;String&gt; call(final TableView&lt;String&gt; arg0)
          {
              final TableRow&lt;String&gt; row = new TableRow&lt;String&gt;() {
  
                  @Override protected void updateItem(final String line, final boolean empty)
                  {
                      super.updateItem(line, empty);
  
                      this.getStyleClass().add("myrow");
                  }
              };
  
              return row;
          }
      }
  
  }
  </code></pre>