1

如何在 javafx中使用边框间距属性?

就像在 css for html 中一样

table.ex1 {
    border-collapse: separate;
    border-spacing: 10px 50px;
}

如何在 javafx 中使用边框间距?

在 TabPane 里面我想在每个选项卡下放置一个底部边框,我的 css 是

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
    -fx-border-width: 4px;
    -fx-border-color: transparent transparent white transparent;


}

它的工作,我有很好的底部边框,但我需要更多的边框间距,所以有人请告诉我该怎么做?

提前致谢。

4

2 回答 2

1
.tab:top{
-fx-background-color: transparent;
-fx-border-insets: 0 0 0 0;
-fx-border-color: white white white white ; 
-fx-padding: 15px;
}

我认为 javafx css 中没有边框间距类型属性,但无论如何你可以通过选项卡的 -fx-padding 属性在 TabPane 中做到这一点。

于 2015-10-03T05:15:38.597 回答
0

添加一些-fx-border-insets. 就像是

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
    -fx-border-width: 4px, 0px;
    -fx-border-color: transparent transparent white transparent, transparent;
    -fx-border-insets: 0px 0px 2px 0px, 0px 0px 4px 0px ;

}

有关详细信息,请查看CSS 文档Region

于 2015-10-02T14:10:03.833 回答