Disable属性设置为false,可以解决按钮样式阻止按钮被禁用的问题。
代码示例:
Button btn = new Button(); btn.setText("Click Me"); btn.setDisable(false); btn.getStyleClass().add("btn-primary"); // 设置按钮样式
上一篇:按钮样式中前景色无法生效
下一篇:按钮样式:从纯色过渡到渐变色,同时不破坏动画效果。