If I want to allow input of an integer in JOptionPane, I would need
String something= JOptionPane.showInputDialog(null, " ");
int x = Integer.parseInt(something);
However, this time I want to input string into the JOptionPane
InputDialog. Is there any way similar to int x = Integer.parseInt();
but works for the string?
And, how do I make an advance feature whereby the program will be able to detect error such as invalid input? Eg. when the user(s) input space and enter instead of a value or a word, or their answer is out of range. So basically their answer is something like space or -99 when answer should be within 1 to 100.
I'm sorry if this sounds dumb, I am very new to programming.