【问题标题】:customize the background of ControlsFX Notification自定义 ControlsFX 通知的背景
【发布时间】:2018-01-10 15:42:11
【问题描述】:

如何在 java 或 css 中将白色背景更改为绿色背景?

Notification 类没有getStylesheet() 方法。

enter image description here

【问题讨论】:

    标签: javafx


    【解决方案1】:

    您可能需要考虑使用 JavaFX Alert 而不是 ControlsFX 通知。 Alert 有一个实现Styleable 接口的DialogPane,并有一个getStylesheets 方法。

    所以要使用它,你会有类似的东西

    Alert myAlert = new Alert(AlertType.NONE);
    myAlert.getDialogPane().getStylesheets().add("myStylesheet.css");
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-25
    • 2011-10-30
    • 2010-10-16
    • 2018-07-13
    相关资源
    最近更新 更多