In this cell factory for a TableView column:
public class NameFormatCell extends TableCell<Room,String> {
public NameFormatCell() { }
@Override protected void updateItem(final String item, boolean empty) {
super.updateItem(item, empty);
if (item != null) {
setText(item);
setTextFill(isSelected() ? Color.WHITE : Color.BLACK);
setFont(Font.font("Segoe UI", FontWeight.BOLD, 18));
}
}
}
The cell always displays in Black, even if the row is selected in the TableView.
public class NameFormatCell extends TableCell<Room,String> {
public NameFormatCell() { }
@Override protected void updateItem(final String item, boolean empty) {
super.updateItem(item, empty);
if (item != null) {
setText(item);
setTextFill(isSelected() ? Color.WHITE : Color.BLACK);
setFont(Font.font("Segoe UI", FontWeight.BOLD, 18));
}
}
}
The cell always displays in Black, even if the row is selected in the TableView.