2

I'm working on javafx project, I have a FXML interface where I put a tab pane, when I select a tab , the border of the selected button is colored in blue, but the style I want is to let the white color will add no border.

My image here has a blue outline. tab with blue border

to get this image

tab without blue border

my Css code for styling Tab pane:

.tab
{
    -fx-background-color: #fbfbfb;
    -fx-border-width: 0 0 1 0;
    -fx-border-color: #c2c2c2 #c2c2c2 #c2c2c2 #c2c2c2
}
.tab:selected 
{
    -fx-background-radius: 0;
    -fx-background-insets: 0;
    -fx-background-color: #fbfbfb;
    -fx-border-width: 0 0 3 0;
    -fx-border-color: #c2c2c2 #c2c2c2 #ff9500 #c2c2c2
}
.tab-pane *.tab-header-background 
{
    -fx-background-color: #fbfbfb, #fbfbfb, #fbfbfb;
    -fx-border-width: 1 0 1 0;
    -fx-border-color: #c2c2c2 #c2c2c2 #c2c2c2 #c2c2c2
}
Oussama
  • 53
  • 10

2 Answers2

2

To find the default ‪stylesheet of tabPane‬, I looked for the file ‎jfxrt‬.jar in my computer, and I open it in an archiver like WinRAR to get ‪‎caspian‬.css at com/sun/javafx/scene/control/skin/caspian.css. With this knowledge, I can easily see what could be there that causes the issue. caspian.css is also available online, here is the a link to the JavaFX 2.2 version.


my need is the code below :

.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;
}
I changed the color -fx-focus-color: #0093ff; (blue color in selected tab)
Oussama
  • 53
  • 10
-1

Set the outline property to 0

.tab
{
   outline :0;
}
kanudo
  • 2,119
  • 1
  • 17
  • 33