JavaFX - Removing the black line under the tabs in a tab pane

I have a black line under my tab pane. The line is always there and goes from the most left pixel of the first tab a few pixels to the right of the last tab.

I've tried so many CSS selectors now and went through all of the listed selectors in the JavaFX 8 Oracle documentation and I have no idea what causes the black line to be there. I've not seen it ony the many other examples regarding the tab pane here.

It is always there, even when I remove all of my prior styling.

enter image description here

How can I remove it?

1 answer

  • answered 2019-11-13 22:57 sarrrrek

    I've looked into the default caspian.css file embedded into the jfxrt.jar.

    This is defined there for the headers-region class:

    .tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
        -fx-border-style: segments(0.166667em, 0.166667em);
        -fx-border-width: 1;
        -fx-border-color: -fx-focus-color;

    It can be overriden by using:

    .tab-header-area > .headers-region {
        -fx-border-width: 0;

    Results in:

    enter image description here