This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The standard customizer for JFormattedTextField's property FormatterFactory does not support formatting, that is consistent with BigDecimal - using standard format for number leads to ClassCastException, when the value property of the JFormattedTextField is bound to a BigDecimal property. The issue is also described with a partial workaround at http://old.nabble.com/Binding-JFormattedTextField-to-JTable-in-Java-Desktop-Database-Application-template-td22000099.html Although I can add my own support for BigDecimal it's an annoyance... Meanwhile I suggest everyone who needs it to read the following articles... It worked for me, but not without some minor trouble... http://snippets.dzone.com/posts/show/246 http://www.java2s.com/Tutorial/Java/0240__Swing/ABigDecimalobjectcustomformatter.htm
I am sorry, I am not sure that I understand what you request. Could you, please, elaborate on that? I can see one problem in our support that relates to BigDecimal values in JFormattedTextField. When you specify formatterFactory using our customizer and set BigDecimal value to your formattedTextField then getValue() method returns numbers of type Double (when the text of the textField is modified). This can be fixed by setting valueClass property of the corresponding formatter. For example: ((NumberFormatter)jFormattedTextField1.getFormatter()).setValueClass(BigDecimal.class); Is that what you are asking for? In other words, do you ask for the possibility to specify valueClass in the customizer of formatterFactory property?
Yes, adding valueClass to the customizer would be one solution. My first idea was to add a only a bigdecimal preset - either as a special category distinct from "number", or to add a "Big decimal default" under the "integer default" in the formats in "number" category.