While developing a full-screen application on JavaFX 2.2 with tab navigation, I encountered an issue where there is a 10px space at the right side of the headers region. Surprisingly, this space only appears after switching to the last tab and disappears when selecting the first tab again. The other tabs do not affect this space in any way. It seems like the main headers region is causing this gap. I have attached screenshots below to illustrate the problem:
The width of the tabs is calculated using the following formula:
double tabWidth = tabPane.getWidth() / tabPane.getTabs().size();
tabPane.setTabMinWidth(tabWidth);
tabPane.setTabMaxWidth(tabWidth);
All paddings have been removed in CSS classes. Additionally, special colors have been set to identify the culprit of this space - which seems to be the main headers-region. Here are the CSS classes used:
.tab-pane .headers-region {
-fx-background-color: yellow;
-fx-padding: 0;
-fx-background-insets: 0;
-fx-effect: null;
}
.tab-pane {
-fx-background-color: white;
-fx-background-insets:0;
-fx-padding: 0;
}
*.tab-header-background {
-fx-padding:0;
-fx-background-insets:0;
}
.tab-pane *.tab-header-background {
-fx-padding:0;
-fx-background-insets:0;
}
...