I need to generate a "nickname" based on 3 jtextfield, which takes the first two letters of each text ... for example
Juan
Perez
Gonzalez
and let the nick name be
JUPEGO
I need to generate a "nickname" based on 3 jtextfield, which takes the first two letters of each text ... for example
Juan
Perez
Gonzalez
and let the nick name be
JUPEGO
Once you retrieve the content of each jtextfield you must substring each variable. finally it gives you a toUpperCase.
String nombre = "Juan";
String paterno = "Perez";
String materno = "Gonzalez";
String nickname = (nombre.substring(0, 2) + paterno.substring(0, 2) + materno.substring(0, 2)).toUpperCase();