Change JavaFx Tab default Look

前端 未结 1 1903
礼貌的吻别
礼貌的吻别 2020-12-23 17:36

I am trying to change the default look of JavaFx tabs using css.

I managed to achieve following.

\"enter

相关标签:
1条回答
  • 2020-12-23 17:40

    You should also override the CSS:

    .tab-pane:top *.tab-header-area {
        -fx-background-insets: 0, 0 0 1 0;
     /* -fx-padding: 0.416667em 0.166667em 0.0em 0.833em; /* 5 2 0 10 */
        -fx-padding: 0.416667em 0.166667em 0.0em 0.0em; /* overridden as 5 2 0 0 */
    }
    

    Here the left padding value of the tab-header-area changed from 10 to 0. In addition you need to override other CSS selectors: .tab-pane:bottom, .tab-pane:left and .tab-pane:right in the same manner for different javafx.geometry.Sides of the TabPane.

    0 讨论(0)
提交回复
热议问题