How do I allow the display to show numbers with the commas, but then when it does the calculations, have the commas go away for the math since obviously java can't read commas in calculations?
example

DecimalFormat df0 = new DecimalFormat("###,###.00");
JFormattedTextField loanText = new JFormattedTextField(df0);

the user puts a number in say 500000, and when the user goes to the next TextField, it automatically sets the loanTextField to 500,000 since I told it to.

When the program takes those TextFields and grabs the number 500,000 - it reverts the number back to 500000 so it can read it?

I tried using the

loanText.replace(",", "");

but that only works with a String, not a JFormattedTextField

anyone?

You can leave the text field as it is and fix the commas after you read the text into your program, ie
String textWithoutCommas = loanText.getText().replace(",", "");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.