Reputation: 631
I want to style a RadioButton as a normal button, but keep the RadioButton's functionality.
Instead of writing this in my code:
radioButton.getStyleClass().remove("radio-button");
radioBUtton.getStyleClass().add("toggle-button");
I want to do it in SceneBuilder. I'm aware that SceneBuilder has this section in the Inspector Panel:
But I only know how to add style-classes, not remove them. So it still has the RadioButton styling with the dot on the left. How can I do this in SceneBuilder, or, if I can't, can I include it in the CSS somehow? Or must I have it done in the code itself?
Upvotes: 1
Views: 538
Reputation: 11
There is definitely no way to accomplish your goal through Scene-Builder, since it was only developed in use as a UI Layout Tool. You can think of the manual adding and removing of a style class as a “preview” and current state of a class a node possesses but you cannot remove it again programmatically using the Builder.
The best way to solve this would be as you have already mentioned by applying this code into your controller-class:
radioButton.getStyleClass().remove("radio-button");
radioBUtton.getStyleClass().add("toggle-button");
Upvotes: 1