You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I want to say, thanks a lot for this fantastic library. I especially like MFXTableView, its filtering feature is fantastic!
I run into a small problem, I am trying to change the text color of the MFXTableView row and it doesn't work - text color stays black.
I can change only background color (via -fx-background-color), but not the foreground / text color:
mfxTableView.setTableRowFactory( data-> {
MFXTableRow<Data> row = new MFXTableRow<>(mfxTableView, data) {
@Override
public void updateItem(Data data) {
super.updateItem(data);
if (data== null) {
setStyle("");
} else {
setStyle(switch (data.getType()) {
case DEFAULT -> "-fx-text-fill: black;";
case VARIANT1-> "-fx-text-fill: red;";
case VARIANT2-> "-fx-text-fill: blue;";
case VARIANT3-> "-fx-text-fill: green;";
});
}
}
return row;
});
I tried to google and search solutions, ChatGPT is telling me to do the same (with TableView/ TableRow / updateItem(T, boolean).
I am a JavaFX noob so it's always possibility I missed something essential.
Thanks a lot for any help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First, I want to say, thanks a lot for this fantastic library. I especially like MFXTableView, its filtering feature is fantastic!
I run into a small problem, I am trying to change the text color of the MFXTableView row and it doesn't work - text color stays black.
I can change only background color (via -fx-background-color), but not the foreground / text color:
I tried overriding updateItem and updateRow and it didn't work.
Link to the original code.
I tried to google and search solutions, ChatGPT is telling me to do the same (with TableView/ TableRow / updateItem(T, boolean).
I am a JavaFX noob so it's always possibility I missed something essential.
Thanks a lot for any help!
Beta Was this translation helpful? Give feedback.
All reactions