In my JavaFX application, I'm working with a table and I want users to be able to change the color of the selected element using a color picker.
However, when I attempt the following code:
menuBar.setStyle("-fx-background-color:" + settings.getRgbString(memberView.colorPicker.getValue()));
I realized that there's no way to apply this style only to the selected item. I've tried using pseudo classes but I can't seem to figure it out. How can I resolve this issue?
It's worth noting that changing the background of buttons works perfectly fine using this method.