±Û¾´ÀÌ :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");
}
.
.
.