I was trying to wrap text for a particular table column in my TableView. I implemented the below code for that. Problem with this code is that it sets the default Text color as Black. It changes the color for other columns but not for this one. I want to change the color of this column as well when the Table Row is selected.
addressCol.setCellFactory(tc -> {
TableCell<Customer, String> cell = new TableCell<>();
Text text = new Text();
text.setStyle("-fx-text-alignment: CENTER;");
cell.setGraphic(text);
cell.setPrefHeight(Control.USE_COMPUTED_SIZE);
text.wrappingWidthProperty().bind(addressCol.widthProperty());
text.textProperty().bind(cell.itemProperty());
return cell ;
});