Abr
18
2009
How to read a jPassword field content
Escrito por: jamslug en General, Programación, tags: j2ee, J2SE, JAVA, jPasswordA few days ago some of my students asked me how to work with jPassword fields, at this moment I wasn’t sure how to do it, but this morning playing around with a little app I finally found it - really simple indeed -:
//how to read a password field
char[] auxiliar;
StringBuffer password = new StringBuffer();
auxiliar = jPasswordField1.getPassword();
for(int i=0; i<auxiliar.length; i++){
password.append(auxiliar[i]);
}
System.out.println(password.toString());
Happy Hacking!
Comparte esto con tus amigos:
Entradas (RSS)