I am making a string array so user can type whatever they want.
the problem the code i have below user can enter &, alt, up, @, in string array.
I want user to enter letters and numbers only, and 1st char has to be letter. I couldnt find any method for it.
int z = 0;
String username[] = new String[3];
public void keyPressed(KeyEvent e)
{
int keys = e.getKeyCode();
username[z] = KeyEvent.getKeyText(keys);
e.consume();
}
public void keyReleased(KeyEvent e)
{
int keys = e.getKeyCode();
z++;
e.consume();
}