edu.harvard.hul.ois.jhove.viewer.NumericField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jhove-apps Show documentation
Show all versions of jhove-apps Show documentation
Classes and fat JAR packaging for CLI and GUI app.
The newest version!
/**********************************************************************
* Jhove - JSTOR/Harvard Object Validation Environment
* Copyright 2004 by JSTOR and the President and Fellows of Harvard College
**********************************************************************/
package edu.harvard.hul.ois.jhove.viewer;
import javax.swing.*;
import java.text.NumberFormat;
/**
*
* A JTextField which permits only decimal digits
*
* @author Gary McGath
*
*/
public class NumericField extends JFormattedTextField {
// Initializer for number format
private static NumberFormat numFormat =
NumberFormat.getIntegerInstance ();
public NumericField (int init)
{
super (numFormat);
numFormat.setGroupingUsed (false);
numFormat.setParseIntegerOnly (true);
setValue (new Integer (init));
}
}