CSSで枠線の幅を設定
枠線の幅を設定するには「-fx-border-width」を使用します。
-
-fx-border-width
-fx-border-widthは「上・下・左・右」の位置を、それぞれ個別に設定することも可能です。
纏めて設定する場合
-
-fx-border-width : 3
個別に設定する場合
-
-fx-border-width : 3 3 3 3
各種コントロールのsetStyleメソッドで「-fx-border-width: 3」を設定した実行結果を以下に示します。
※デフォルトの設定では「-fx-border-color」がnullのため、枠線が表示されませんので「-fx-border-color: black」を同時に設定しています。<< -fx-border-colorの説明はこちらへ >>
-
setStyle( "-fx-border-color:red;-fx-border-width:3" )
実行例
Label
![](image/CSS_Label005.png)
Button
![](image/CSS_Button005.png)
TextField
![](image/CSS_TextField005.png)
TextArea
![](image/CSS_TextArea005.png)
CheckBox
![](image/CSS_CheckBox005.png)
RadioButton
![](image/CSS_RadioButton005.png)
ChoiceBox
![](image/CSS_ChoiceBox005.png)
ListView
![](image/CSS_ListView005.png)
ComboBox
![](image/CSS_ComboBox005.png)
Slider
![](image/CSS_Slider005.png)
Progress
![](image/CSS_ProgressBar005.png)
ToolBar
![](image/CSS_ToolBar005.png)
TreeView
![](image/CSS_TreeView005.png)
TreeTableView
![](image/CSS_TreeTableView005.png)
![](http://www12.a8.net/0.gif?a8mat=1TV743+7K35S2+249K+BWGDT)