I am using JFormattedTextField to display percentage values in a text field as below:
NumberFormat percentDisplayFormat = NumberFormat.getPercentInstance();
NumberFormat editFormat = NumberFormat.getNumberInstance();
percentDisplayFormat.setMinimumFractionDigits(2);
NumberFormatter percentEditFormatter = new NumberFormatter(editFormat);
JFormattedTextField jftfPercentage = new JFormattedTextField(new DefaultFormatterFactory(new NumberFormatter(percentDisplayFormat), new NumberFormatter(percentDisplayFormat), percentEditFormatter));
jftfPercentage.setBounds(113, 95, 236, 21);
jftfPercentage.setName("JftfPercentage");
And setting the value like below:
jftfPercentage.setValue(<someDoubleValue>);
Now, suppose I have set the value as 80, then it is displaying the value as 8000%.
But, whenever I click on the field, it is displaying as 80 only.
Can someone help me on displaying the same value that we set. Thanks in advance