Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove shadow from JavaFX tabs?

Tags:

java

javafx

I have tabs in JavaFX and I want to set a style to remove the shadows:

enter image description here

If you look at the left side of foo, you can see shadows.

This is my current style:

.tab {
    -fx-background-color: #393939;
    -fx-border-color: #282828;
    -fx-border-width: 0;
    -fx-padding: 1 8;
}

I've tried to look into the documentation, but could not find a way to remove shadows: http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#tabpane

like image 641
Tower Avatar asked Aug 28 '12 17:08

Tower


1 Answers

To find the default stylesheet, search for the file jfxrt.jar on your computer, open it in an archiver like WinRAR and open com/sun/javafx/scene/control/skin/caspian.css. With this knowledge, you 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.

Now, add this style:

.tab-pane .headers-region {
    -fx-effect: null;
}

It removes the default style and the shadows are gone.

like image 74
Kai Sellgren Avatar answered Oct 13 '22 23:10

Kai Sellgren