I'm having a bit of trouble trying to figure out how to prevent user input that are numerical. I understand how to prevent non-numerical inputs (ie. inputting a letter instead of a number) but not the other way around. How do I work around this?
String[] player_Name = new String[game];
for (i = 0; i < game; i++) {
try {
player_Name[i] = JOptionPane.showInputDialog("Enter the name of the
player, one by one. ");
} catch(Exception e) {
JOptionPane.showMessageDialog(null, "Enter a valid name!");
i--;
}