![JAR search and dependency download from the Maven repository](/logo.png)
gov.nih.nlm.nls.lvg.Tools.GuiTool.GuiLib.IntTextField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lvg2010dist Show documentation
Show all versions of lvg2010dist Show documentation
LVG tools is used by Apache cTAKES.
The newest version!
package GuiTool.GuiLib;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class IntTextField extends JTextField
{
public IntTextField(int defval, int size)
{
super("" + defval, size);
}
protected Document createDefaultModel()
{
return new IntTextDocument();
}
public boolean isValid()
{
try
{
Integer.parseInt(getText());
return true;
}
catch(NumberFormatException e)
{
return false;
}
}
public int getValue()
{
try
{
return Integer.parseInt(getText());
}
catch(NumberFormatException e)
{
return 0;
}
}
private final static long serialVersionUID = 5L;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy