0

私が抱えている問題は、行を選択すると、カスタム セル レンダラーを持つセルがそのセルを強調表示せず、他のセルを強調表示することです。

public Component getTableCellRendererComponent(
    JTable table,
    Object value,
    boolean isSelected,
    boolean hasFocus,
    int row,
    int column)
{
    setFont(ApplicationStyles.TABLE_FONT);

    if (value != null)
    {
        BigDecimal decimalValue = toBigDecimal(value);
        decimalValue =
            decimalValue.setScale(2, BigDecimal.ROUND_HALF_EVEN);

        DecimalFormat formatter = new DecimalFormat("$##,##0.00");
        formatter.setMinimumFractionDigits(2);
        formatter.setMinimumFractionDigits(2);
        String formattedValue = formatter.format(value);
        setText(formattedValue);
    }
    return this;
}
4

2 に答える 2