Input masking


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

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


´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]