如何从JavaFX选项卡中删除阴影?

问题描述:

我在JavaFX中具有选项卡,并且我想设置一种样式来消除阴影:

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

如果您查看foo的左侧,则会看到阴影.

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

这是我目前的风格:

.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

要查找默认样式表,请在计算机上搜索文件jfxrt.jar,在诸如WinRAR之类的存档器中将其打开,然后打开com/sun/javafx/scene/control/skin/caspian.css.有了这些知识,您就可以轻松地了解导致问题的原因.

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也可以在线获得,这是

caspian.css is also available online, here is the a link to the JavaFX 2.2 version.

现在,添加此样式:

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

它删除了默认样式,阴影消失了.

It removes the default style and the shadows are gone.