Example usage for javax.swing.text NumberFormatter setMinimum

List of usage examples for javax.swing.text NumberFormatter setMinimum

Introduction

In this page you can find the example usage for javax.swing.text NumberFormatter setMinimum.

Prototype

public void setMinimum(Comparable<?> minimum) 

Source Link

Document

Sets the minimum permissible value.

Usage

From source file:org.yccheok.jstock.gui.portfolio.SplitJDialog.java

private JFormattedTextField getUnitJFormattedTextField() {
    NumberFormat format = new DecimalFormat("#,##0.###");
    NumberFormatter formatter = new NumberFormatter(format);
    formatter.setMinimum(1.0);
    formatter.setValueClass(Double.class);
    JFormattedTextField field = new JFormattedTextField(formatter);
    return field;
}