CSSを用いた背景色の設定
背景色を設定するには「-fx-background-color」を使用します。
-
-fx-background-color
各種コントロールのsetStyleメソッドで「-fx-background-color: green」を設定した実行結果を以下に示します。
-
setStyle( "-fx-background-color: green" )
実行例
Label

Button

TextField

TextArea
入力フィールドの後ろがGreenになっているのか?フチがgreenになった。TextFieldと同じ結果にならないことが興味深い。

CheckBox

RadioButton

ChoiceBox

ListView
背景がGreenになっているのか?フチがGreenになった。

ComboBox

Slider

Progress
TextArea、ListViewと同様に、フチがGreenになった。

ToolBar

TreeView
背景がGreenになっているのか?フチがGreenになった。

TreeTableView
背景がGreenになっているのか?フチがGreenになった。

