use of javax.swing.text.InternationalFormatter in project EnrichmentMapApp by BaderLab.
the class CutoffPropertiesPanel method getFormatterFactory.
private static AbstractFormatterFactory getFormatterFactory(boolean scientific) {
return new AbstractFormatterFactory() {
@Override
public AbstractFormatter getFormatter(JFormattedTextField tf) {
NumberFormat format = scientific ? new DecimalFormat("0.######E00") : new DecimalFormat();
format.setMinimumFractionDigits(scientific ? 0 : 1);
format.setMaximumFractionDigits(12);
InternationalFormatter formatter = new InternationalFormatter(format);
formatter.setAllowsInvalid(true);
return formatter;
}
};
}
Aggregations