所有 FXML 默认按钮的 JavaFX CSS
JavaFX CSS for all FXML Default Buttons
我在所有模式 Windows 上使用默认按钮 属性。
哪个 CSS 属性 无需创建新的 CSS class id 即可修改所有这些?
默认都是浅蓝色,字体颜色是黑色,我不太喜欢。
根据documentation,你应该可以使用
.button:default {
/* your style rules here */
}
在您的外部 CSS 文件中。
默认样式表 modena.css 具有规则
.button:default {
-fx-base: -fx-default-button ;
}
其中-fx-default-button
定义为淡蓝色:
-fx-default-button: #ABD8ED;
所以另一种选择就是更改 -fx-default-button
:
的定义
.root {
-fx-default-button: /* your preferred color here */ ;
}
我在所有模式 Windows 上使用默认按钮 属性。
哪个 CSS 属性 无需创建新的 CSS class id 即可修改所有这些?
默认都是浅蓝色,字体颜色是黑色,我不太喜欢。
根据documentation,你应该可以使用
.button:default {
/* your style rules here */
}
在您的外部 CSS 文件中。
默认样式表 modena.css 具有规则
.button:default {
-fx-base: -fx-default-button ;
}
其中-fx-default-button
定义为淡蓝色:
-fx-default-button: #ABD8ED;
所以另一种选择就是更改 -fx-default-button
:
.root {
-fx-default-button: /* your preferred color here */ ;
}