1

I am formatting a text field like this:

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);

But I would like to make part or last 2 digits BOld or diff color a bit like:

enter image description here

How can I do that?

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
  • NOT POSSIBLE . correct me if i am wrong :) solution would be to use multiple labels and split up the text – Srinath Ganesh Mar 10 '14 at 16:30
  • I think it might be. The above is from java and I managed to change the number of pips displayed. I don't think I could have done that if it was multiple fields. – ManInMoon Mar 10 '14 at 16:45
  • +1 for question, maYBe but I don't know how to do it without using a Html – mKorbel Mar 10 '14 at 20:16
  • the reason i said its **not possible** is **Because** you can format the whole jtextfield but **partial** one has no predefined methods to use .. **maybe creating CustomJTextfield extending jtextfield will help** – Srinath Ganesh Mar 11 '14 at 08:12

0 Answers0