Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
启用排序时的JavaFX Tableview标题颜色_Java_Javafx - Fatal编程技术网

启用排序时的JavaFX Tableview标题颜色

启用排序时的JavaFX Tableview标题颜色,java,javafx,Java,Javafx,我试图更改标题的颜色,但每次我通过单击其中一个列标题对行进行排序时,它都会变成这样: 如何将“排序箭头”背景漆成蓝色,使整个标题变为蓝色,箭头变为白色?谢谢你的帮助 编辑1 通过使用@extractic代码,我成功地得到了我想要的: 以下是一些有用的css帮助您: /** color everything under the column header */ .table-view .column-header * { -fx-background-color: blue; } /*

我试图更改标题的颜色,但每次我通过单击其中一个列标题对行进行排序时,它都会变成这样:

如何将“排序箭头”背景漆成蓝色,使整个标题变为蓝色,箭头变为白色?谢谢你的帮助

编辑1

通过使用@extractic代码,我成功地得到了我想要的:


以下是一些有用的css帮助您:

/** color everything under the column header */
.table-view .column-header * {
    -fx-background-color: blue;
}

/** color the arrow */
.table-view .column-header .arrow {
    -fx-background-color: black;
}

/** color the column header text */
.table-view .column-header .label {
    -fx-text-fill: white;
}

/** add slight dividers between headers */
.table-view .column-header {
    -fx-border-color: white;
    -fx-border-width: .1
}

/** color the scroll bar background and thumb */
.table-view .scroll-bar {
    -fx-background-color: white;
}
.table-view .scroll-bar .thumb {
    -fx-background-color: blue;
}

以下是一些有用的css帮助您:

/** color everything under the column header */
.table-view .column-header * {
    -fx-background-color: blue;
}

/** color the arrow */
.table-view .column-header .arrow {
    -fx-background-color: black;
}

/** color the column header text */
.table-view .column-header .label {
    -fx-text-fill: white;
}

/** add slight dividers between headers */
.table-view .column-header {
    -fx-border-color: white;
    -fx-border-width: .1
}

/** color the scroll bar background and thumb */
.table-view .scroll-bar {
    -fx-background-color: white;
}
.table-view .scroll-bar .thumb {
    -fx-background-color: blue;
}

边框宽度中的.1是一个像素吗?比一个像素小,它会使它混合一点,这是我喜欢的效果。还要注意的是,我发现箭头周围还有一些轻微的未着色背景,我也在努力处理这些。@JeanWillianS.J。添加
.table view.column header*
将给表格标题下的所有内容上色,从那里您可以专门设置箭头的颜色。边框宽度中的.1是一个像素吗?小于一个像素,它会使其混合一点,这是我喜欢的效果。还要注意的是,我发现箭头周围还有一些轻微的未着色背景,我也在努力处理这些。@JeanWillianS.J。添加
.table view.column header*
将给表标题下的所有内容上色,从那里您可以专门设置箭头的颜色。您的问题是如何仅在“显示排序箭头”时将每个列的背景设为蓝色,还是希望默认情况下以蓝色显示所有列?嗯。。。从用户体验的角度来看,这看起来很糟糕:现在还没有直接的视觉线索显示一列的结束位置(并且可以调整大小,f.i.)@kleopatra那么你有什么建议?我正在学习如何使用JavaFx,所以我对它的功能不太了解。您的问题是专门针对如何仅在“显示排序箭头”时将每个列的背景设置为蓝色,还是希望默认情况下以蓝色显示所有列?嗯。。。从用户体验的角度来看,这看起来很糟糕:现在还没有直接的视觉线索显示一列的结束位置(并且可以调整大小,f.i.)@kleopatra那么你有什么建议?我正在学习如何使用JavaFx,所以我对它的特性不太了解。