Css tp如何在JFXListView中为所选标签设置不同的字体填充文本颜色?

Css tp如何在JFXListView中为所选标签设置不同的字体填充文本颜色?,css,javafx,Css,Javafx,我已经在FXML文件中创建了JFXListView: <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> <children> <JFXListView fx:id="listName" layoutX="-1.0" layoutY="-5.0" /> </children> </AnchorPan

我已经在FXML文件中创建了JFXListView:

<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
    <children>
        <JFXListView fx:id="listName" layoutX="-1.0" layoutY="-5.0"   />
    </children>
</AnchorPane>

将此css部分添加到文件中,它将更改选定的文本颜色

.mylistview .list-cell:selected .label{
    -fx-text-fill: rgb(20, 20, 20);
}
您也可以删除此部分

.mylistview:focused .label:selected {
    -fx-text-fill: while;
}

将此css部分添加到文件中,它将更改选定的文本颜色

.mylistview .list-cell:selected .label{
    -fx-text-fill: rgb(20, 20, 20);
}
您也可以删除此部分

.mylistview:focused .label:selected {
    -fx-text-fill: while;
}
.mylistview:focused .label:selected {
    -fx-text-fill: while;
}