【发布时间】:2015-10-23 10:32:11
【问题描述】:
我正在尝试重新创建我在 Swing 中使用的 LookAndFeel。
到目前为止一切正常,但我对按钮的图形节点进行样式设置失败了。
Java-代码:
Button btnAdd= new Button();
btnAdd.setGraphic(iconAdd); //iconAdd = ImageView
CSS:
.button:disabled, .button:default:disabled {
-fx-opacity: 1.0;
-fx-background-color: rgb(239, 239, 239);
-fx-border-color: rgb(217, 217, 217);
}
.button:disabled > .graphic {
-fx-opacity: 0.1;
}
如您所见,我希望按钮在禁用时不透明(这可行!)。
我只希望图形节点,它是按钮的子节点,是透明的。
最好的问候,
强p
【问题讨论】:
标签: java css button javafx styling