首页 > 解决方案 > 如何设置组合框的文本颜色?

问题描述

我正在尝试设置组合框的文本颜色。

我的代码,我试过了 comboList.setStyle("-fx-text-fill: blue");

标签: javafxcombobox

解决方案


试试看

.combo-box .list-cell 
{
    -fx-background: white;
    -fx-background-color: transparent;
    -fx-text-fill: red;
}

在此处输入图像描述


推荐阅读