Java Swing Text Format createIntegerFormatter(int minimum, int maximum)

Here you can find the source of createIntegerFormatter(int minimum, int maximum)

Description

create Integer Formatter

License

LGPL

Declaration

public static NumberFormatter createIntegerFormatter(int minimum, int maximum) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.text.NumberFormat;

import javax.swing.text.NumberFormatter;

public class Main {
    public static NumberFormatter createIntegerFormatter(int minimum, int maximum) {
        NumberFormat format = NumberFormat.getIntegerInstance();
        NumberFormatter formatter = new NumberFormatter(format);
        formatter.setMinimum(minimum);/*  w  w w  . j av  a 2  s .  com*/
        formatter.setMaximum(maximum);
        formatter.setValueClass(Integer.class);
        formatter.setCommitsOnValidEdit(true);
        return formatter;
    }
}

Related

  1. buildIntegerField(int min, int max)
  2. checkBoundaryCondition(final int pos, final Position.Bias b0, final Position.Bias[] biasRet, final Element neighboringElement, final boolean isLTR, final boolean toWest, final int start, final int length, final int startParagraph, final int endParagraph, final boolean nextIsLTR)
  3. createFormattedDateField(DateFormat dfFormat, boolean bOverwriteMode)
  4. createFormatter(String s)
  5. createFormatterMask(final String mask)
  6. createMaskFormatter(final String s)
  7. dataFormatada(Calendar cal)
  8. findElementUp(String name, Element start)
  9. findMatchingBracket(Element el, int offset)