-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Labels
Description
This is code:
public class JavaFxTest10 extends Application {
private static record Student (int id, int mark) {};
private TableView<Student> table = new TableView<>(FXCollections.observableList(
List.of(new Student(1, 3), new Student(2, 4), new Student(3, 5))));
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
Application.setUserAgentStylesheet(new Dracula().getUserAgentStylesheet());
var idColumn = new TableColumn<Student, Integer>("Id");
idColumn.setCellValueFactory((data) -> new ReadOnlyObjectWrapper<>(data.getValue().id()));
var markColumn = new TableColumn<Student, Integer>("Mark");
markColumn.setCellValueFactory((data) -> new ReadOnlyObjectWrapper<>(data.getValue().mark()));
table.getColumns().addAll(idColumn, markColumn);
table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
table.getSelectionModel().setCellSelectionEnabled(true);
VBox root = new VBox(new TextField(), table);
var scene = new Scene(root, 400, 300);
primaryStage.setScene(scene);
primaryStage.show();
}
}
If you run it with AtlantaFX you will get this result:
If cell selection is disabled then you will get this result:
As you see selection color is different in both cases. However in pure JavaFX selection color is always the same:
Is this a bug I misunderstand something?