I have a listview. I want to change the color of the background and the text fill. I have tried doing the following:
playlistView.setStyle("-fx-background-color: blue; -fx-text-fill: black;");
But, this doesn't work. However, the following is working:
playlistView.setStyle("-fx-font-size: 24px; -fx-font-family: 'SketchFlow Print';");
Can you please tell me how to get the background and text-fill to work? Thank you.
Best Answer
You can use the following CSS styles:
lisStyles.css
.Add the URL for the
lisStyles.css
style sheet to the scene:scene.getStylesheets().add(getClass().getResource("lisStyles.css").toExternalForm());