spider/spider-web/IntTextField.java
minima f319bf06d7 add another java client
fix a problem with 'sorry connected to another ...'
2001-04-28 20:29:06 +00:00

37 lines
452 B
Java
Executable File

import java.awt.*;
public class IntTextField extends TextField
{
public IntTextField()
{
;
}
public IntTextField(String s)
{
this.setText(s);
}
public boolean isValid()
{
int value;
try
{
value = Integer.valueOf(getText().trim()).intValue();
}
catch (NumberFormatException e)
{
requestFocus();
return false;
}
return true;
}
public int getValue()
{
return Integer.parseInt(getText().trim(),10);
}
}