【发布时间】:2016-06-20 08:25:21
【问题描述】:
【问题讨论】:
标签: java css javafx dialog alert
【问题讨论】:
标签: java css javafx dialog alert
Alert 的 Modena.css 样式可从 ~ 第 3339 行获得 here
对于详细信息按钮,感兴趣的选择器将是:
.dialog-pane > .button-bar > .container > .details-button {
-fx-alignment: baseline-left;
-fx-focus-traversable: false;
-fx-padding: 0.416em; /* 5px */
}
.dialog-pane > .button-bar > .container > .details-button.more {
-fx-graphic: url("dialog-more-details.png");
}
.dialog-pane > .button-bar > .container > .details-button.less {
-fx-graphic: url("dialog-fewer-details.png");
}
.dialog-pane > .button-bar > .container > .details-button:hover {
-fx-underline: true;
}
CSS:
.dialog-pane > .button-bar > .container > .details-button.more {
-fx-background-color: red;
}
.dialog-pane > .button-bar > .container > .details-button.less {
-fx-background-color: green;
}
您也可以通过修改-fx-graphic来更改图片,但图片必须是您想要的尺寸。以下图片使用 24 x 24 图标
CSS:
.dialog-pane > .button-bar > .container > .details-button.more {
-fx-graphic: url("unchecked_checkbox.png");
}
.dialog-pane > .button-bar > .container > .details-button.less {
-fx-graphic: url("checked_checkbox.png");
}
【讨论】: