JFormattedTextField异常格式

时间:2014-03-10 16:25:28

标签: java swing formatting jformattedtextfield swing-highlighter

我正在格式化这样的文本字段:

bidField = new JFormattedTextField();
DecimalFormat d = new DecimalFormat("0.00");
int dp = 5;
d.setMinimumFractionDigits(dp);

NumberFormatter dnff = new NumberFormatter(d);
DefaultFormatterFactory factory = new DefaultFormatterFactory(dnff);
bidField.setFormatterFactory(factory);

但我想制作部分或最后两位数字BOld或diff颜色有点像:

enter image description here

我该怎么做?

0 个答案:

没有答案