Anything entered in a JOptionPane is stored as a string inJava.
When using "JOptionPane.showInputDialog" you canonly check the result of the input.
If it is not satisfied, re-query input.
Or you can use JTextField (allows the use of any filters onthe input.)
More details here:
https://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/JTextField.html
Comments
Leave a comment