I'm trying to set css for a TabPane in JavaFX. I have two TabPanes created but for one of the TabPanes I used CSS to hide the tabs (weird I know) while the other TabPane I intend on using the default css.
However when I go to apply the css, it is applying to both the nodes. How do I fix this issue so that only one of the TabPanes use the css?
Code:
tabPane.getStyleClass().add("customTab");
tabPane.getStylesheets().add("/resources/css/TabPane.css");
CSS
.customTab{
-fx-tab-max-height: 0 ;
}
.customTab .tab-header-area {
visibility: hidden ;
}
.customTab .tab-header-area .tab-header-background {
-fx-background-color: #f4f4f4;
}
.customTab .tab {
-fx-background-color: #f4f4f4;
}
.customTab .detailed .tab {
-fx-background-color: #f4f4f4;
}
.customTab .detailed .tab-header-area .tab-header-background {
-fx-background-color: #f4f4f4;
}
I have also tried following this post and using "setId()" but got the same results.
#customTab .tab-header-area {
visibility: hidden ;
}
and
.customTab.tab-header-area {
visibility: hidden ;
}
and
.customTab > .tab-header-area {
visibility: hidden ;
}
Please inform me the correct way of doing this.
Thank you.