0

テーマで黒に設定しても、ComboBox のテキストの色は白です。TextField のテキストの色は想定どおり黒です。ComboBox のテキストの色が黒でないのはなぜですか?

テーマ:

fgColor=FFFFFF  
bgColor=000000  
sel#fgColor=FFFFFF  
sel#bgColor=EE8207  
ComboBox.fgColor=000000  
ComboBox.bgColor=FFFFFF  
ComboBox.sel#fgColor=000000  
ComboBox.sel#bgColor=FFFFFF  
TextField.fgColor=000000  
TextField.bgColor=FFFFFF  
TextField.sel#fgColor=000000  
TextField.sel#bgColor=FFFFFF  
4

3 に答える 3

1

このようにテキストの色を変更できます

Style selStyle = UIManager.getInstance().getComponentSelectedStyle("ComboBoxItem");
selStyle.setFgColor(0x00AF00);   // Selected Item will be in green color
UIManager.getInstance().setComponentSelectedStyle("ComboBoxItem", selStyle);

Style unSelStyle = UIManager.getInstance().getComponentStyle("ComboBoxItem");
unSelStyle.setFgColor(0x000000); // Selected Item will be in black color   
UIManager.getInstance().setComponentStyle("ComboBoxItem", unSelStyle);

これで治ります!!

于 2011-04-11T11:12:10.907 に答える
0

hexColorsを使用する必要があります:"0x000000"または"0xffffff"

次の方法を使用して、アプリで色を設定することもできます。

lwuitはintを使用して色を設定し、intを計算するには次の関数を使用します。

public static int colorStringToInt(String hexColor) {
    int color;
    try {
        color = Integer.parseInt(hexColor.substring(2), 16);
        return color;
    } catch (Exception ex) {
        ex.printStackTrace();
        return -1;//no negative colors
    }
}

このように色を設定します。

int color = AppUtils.colorStringToInt("0xffffff");//white
if (color != -1) {
    b.getStyle().setFgColor(color, true);
}
于 2010-12-09T16:13:50.440 に答える
0

あなたはこのように使うことができます、

ComboBoxItem.fgColor=000000  

ComboBoxItem.sel#fgColor=ffffff

ResourceEdit を使用していますか。手段を使用しない場合は、ResourceEdit を使用してテーマを作成します。

于 2010-11-24T13:33:24.483 に答える