且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JavaFX风格的所有相同类型的节点,例如,VBox

更新时间:2023-02-11 14:00:12

我自己找到了一个解决方案。您可以像下面这样将一个窗格(如VBox)的简单类名添加到.css文件中:

I myself found a solution. You can add this simple class name of a pane such as VBox to your .css file like this:

HBox, VBox {
    //css instructions here
    -fx-background-color: red;
}

请注意,名称区分大小写;在名称之前不需要点。

Note that names are case sensitive; No dot is required before the name.