本文整理汇总了Java中com.trollworks.toolkit.utility.text.DoubleFormatter类的典型用法代码示例。如果您正苦于以下问题:Java DoubleFormatter类的具体用法?Java DoubleFormatter怎么用?Java DoubleFormatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleFormatter类属于com.trollworks.toolkit.utility.text包,在下文中一共展示了DoubleFormatter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNumericCompareField
import com.trollworks.toolkit.utility.text.DoubleFormatter; //导入依赖的package包/类
/**
* @param compare The current compare object.
* @param min The minimum value to allow.
* @param max The maximum value to allow.
* @param forceSign Whether to force the sign to be visible.
* @return The {@link EditorField} that allows a double comparison to be changed.
*/
protected EditorField addNumericCompareField(DoubleCriteria compare, double min, double max, boolean forceSign) {
EditorField field = new EditorField(new DefaultFormatterFactory(new DoubleFormatter(min, max, forceSign)), this, SwingConstants.LEFT, Double.valueOf(compare.getQualifier()), Double.valueOf(max), null);
field.putClientProperty(DoubleCriteria.class, compare);
UIUtilities.setOnlySize(field, field.getPreferredSize());
add(field);
return field;
}
示例2: createMarginField
import com.trollworks.toolkit.utility.text.DoubleFormatter; //导入依赖的package包/类
private static EditorField createMarginField(double margin, JPanel wrapper) {
EditorField field = new EditorField(new DefaultFormatterFactory(new DoubleFormatter(0, 999.999, false)), null, SwingConstants.RIGHT, new Double(margin), new Double(999.999), null);
UIUtilities.setOnlySize(field, field.getPreferredSize());
wrapper.add(field);
return field;
}