±Û¾´ÀÌ :Sung Yi 2000³â 2¿ù 05ÀÏ 03:06:32
In Reply to: textboxÀÇ ³»¿ëÀÌ ¹®ÀÚÀΰ¡,¼ýÀÚÀΰ¡ ±¸º°Çϴ¹ý Á» °¡¸£ÃÄ ÁÖ¼¼¿ä.. posted by ±è¿ëÈñ on 2000³â 2¿ù 01ÀÏ 16:38:12:
There are a few ways to handle this. The easiest way is to get an input text and use the Integer class to determine if it is a number or not.
import java.lang.*;
String xxx = textbox.getText();
//say that you are expecting an integer value
try{
int yyy = Integer.parseInt(xxx);
System.out.println("number: " + yyy);
}
catch(NumberFormatException nfe){
System.out.println(xxx + " is not a number");
}
.
.
.