Java - PARA QUE SOLO ME ACEPTE....ALFABETO...Y NO NUMEROS

 
Vista:

PARA QUE SOLO ME ACEPTE....ALFABETO...Y NO NUMEROS

Publicado por Andres (39 intervenciones) el 09/04/2007 02:51:24
HOLA..MIRA QUIERO..QUE EN UN CAMPO........DONDE DICE NOMBRE..SOLO ME ACEPTE NOMBRE Y NO NUMEROS...COMO HAGO....(LO ESTOY HACIENDO.EN PANTALLASO DE DOS):
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:PARA QUE SOLO ME ACEPTE....ALFABETO...Y NO NUME

Publicado por angel (537 intervenciones) el 09/04/2007 10:50:29
Pues tienes muchas maneras....una de ellas s usar un sencillo método como este...

/**Devuelve verdadero si encuentra algun numero dentro del texto, di no devuelve falso*/
private boolean pruebaDigitos(String texto)
{
for(int i=0;i<texto.length();i++)
{

if(Character.isDigit(texto.charAt(i)))
return true;
}
return false;
}

Le pasas en texto que capturas y compruebas que no tnga numeros

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar