글쓴이 :Sung Yi 2000년 2월 15일 02:02:13
In Reply to: 폼필드 내에서 '오기입' 에러 메시지 뜨게 하는 소스?? posted by 이재민 on 2000년 2월 14일 14:18:49:
import java.lang.*;
final static int mustBe10 = 10;
String xxx = textbox.getText();
:
:
//say that you are expecting an integer value
try{
int yyy = Integer.parseInt(xxx);
System.out.println("number: " + yyy);
if(xxx.trim().length() != mustBe10)
System.out.println("Number must be " + mustBe10 + " digits long");
}
catch(NumberFormatException nfe){
System.out.println(xxx + " is not a number");
}
.
.
.