我正在实现类似工具箱的窗格,因此用户一次只能选择一个工具,因此我将其行为从切换Button
到RadioButton
。
但是我发现它RadioButton
使用了自己的带点皮肤,但是我仍然希望它显示为法线Button
。我是JavaFX和FXML的初学者,所以有人知道我该怎么做吗?
首先创建一个单选按钮,删除radio-button
样式,然后添加如下toggle-button
样式
RadioButton radioButton=new RadioButton("Radio");
radioButton.getStyleClass().remove("radio-button");
radioButton.getStyleClass().add("toggle-button");
希望能解决您的问题
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句