The default stylesheet, modena.css uses a series of "looked-up colors" (essentially CSS color variables) to define the colors in the JavaFX application. The values of these looked-up colors can be overridden to style or "theme" your application. Only a small number of these looked-up colors are hard-coded; the remainder are dependent on others. So by reading through the default CSS (just the top section and the relevant sections on tables and check boxes) you can fairly readily determine a small number of colors to change.
There are two different properties that change the appearance of the rows: selection and focus. Selection means the row is selected in the sense of the table's selectionModel; focus means the row/cell has keyboard focus.
A focused and selected row has a background color defined by the looked-up color -fx-selection-bar, which in turn is set to the value of -fx-accent (a hard-coded bright blue #0096C9).
Focused controls have "rings" drawn around them in the -fx-focus-color, with a small border defined by -fx-faint-focus-color. Both of these are hard-coded, to #039ED3 and #039ED322 respectively (the latter is just a partially-transparent version of the former).
If the table row is selected and not focused, it's background is set to -fx-selection-bar-non-focused, which is a light grey by default. You might want to override this too, though you didn't indicate in the question if this was desired to be changed. The code below leaves it at its default.
So you can fairly simply change the colors of the table by setting those three looked-up-colors:
.table-view {
-fx-accent: rgb(180, 228, 156);
-fx-focus-color: #03D34E;
-fx-faint-focus-color: #03D34E22;
}
Note if you use the selector .root instead of .table-view you will change selection highlighting for all controls in the scene to be this consistent color.
Here is a complete runnable example. I put the style inline for convenience for prototyping, but you probably want to extract it to an external style sheet in real life.
package org.jamesd.examples.tableselectionstyle;
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.CheckBoxTableCell;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import java.util.Random;
import java.util.function.Function;
public class HelloApplication extends Application {
private final Random rng = new Random();
private static final String STYLE = """
.table-view {
-fx-accent: rgb(180, 228, 156);
-fx-focus-color: #03D34E;
-fx-faint-focus-color: #03D34E22;
}
""";
@Override
public void start(Stage stage) {
TableView<Item> table = new TableView<>();
table.setEditable(true);
for (int i = 1 ; i <= 20; i++) {
table.getItems().add(new Item("Item "+i, rng.nextInt(100)));
}
table.getColumns().add(createColumn("Item", Item::nameProperty));
table.getColumns().add(createColumn("Value", Item::valueProperty));
TableColumn<Item, Boolean> availableCol = createColumn("Available", Item::availableProperty);
availableCol.setCellFactory(CheckBoxTableCell.forTableColumn(availableCol));
table.getColumns().add(availableCol);
BorderPane root = new BorderPane(table);
Scene scene = new Scene(root);
scene.getStylesheets().add("data:text/css," + STYLE);
stage.setScene(scene);
stage.show();
}
private static <S,T> TableColumn<S,T> createColumn(String title, Function<S, ObservableValue<T>> property) {
TableColumn<S,T> column = new TableColumn<>(title);
column.setCellValueFactory(data -> property.apply(data.getValue()));
return column;
}
private static class Item {
private final StringProperty name = new SimpleStringProperty();
private final IntegerProperty value = new SimpleIntegerProperty();
private final BooleanProperty available = new SimpleBooleanProperty();
Item(String name, int value) {
setName(name);
setValue(value);
}
public final String getName() {
return nameProperty().get();
}
public StringProperty nameProperty() {
return name;
}
public final void setName(String name) {
this.nameProperty().set(name);
}
public final int getValue() {
return valueProperty().get();
}
public IntegerProperty valueProperty() {
return value;
}
public final void setValue(int value) {
this.valueProperty().set(value);
}
public final boolean isAvailable() {
return this.availableProperty().get();
}
public BooleanProperty availableProperty() {
return available;
}
public final void setAvailable(boolean available) {
this.availableProperty().set(available);
}
}
public static void main(String[] args) {
launch();
}
}

