I'm trying to change the text color of rows in a TableView.
I need to change the text color in every row that the cell in the Deleted column says "Yes".
When using the setRowFactory() method, I've tried checking the row data's object isDeleted field, and when it is true, using setStyle("-fx-text-fill: blue;") which did not work.
I would appreciate any advice on how to accomplish this.
UPDATE:
I found the answer after a lot of searching.
By adding a custom class to the rows that their text needed changing,
and loading a css file with the code:
.some-class .table-cell{
-fx-text-fill: blue;
}
I've managed to get the desired result.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…