I intialize my JFormattedTextField like this :
JFormattedTextField field = new JFormattedTextField();
field.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
Now, when I enter any number with decimal points, the field returns a Double. When I enter a number without decimal points, it returns a Long. Is there a way to setup the Formatter so it returns a Double even when the number entered has no decimal points ?