you can use the while loop i.e u get the user input and check whether it is numeric by catching the number format exception and if not than agian show the optionpane.
Originally posted by Rasika Chitnis:
What is the way to validate user input for number of seats obtained via a JOptionPane.showInputDialog ? I want to validate that user has entered only numeric. Do I have to write my own class that is a subclass of JDialog ?