For Example, In my gui the user has a field to input the number of seats he or she wishes to purchase I will compare the available seats that are availble first then how do I validate that the input data is a number and not a string or garbage??? I already have a BookSeat button with action event.
posted 16 years ago
There are many ways to approach this. The core Java 2 vol 1 book has a section on consuming key events (ch. Event Handling), so as to disregard any key events that don't correlate to numbers Or you can parse the trimmed input from the textbox and catch a NumberFormatException when the input is processed. Ken
Ken Zrobok<BR>Java Developer/Trainer<BR>SCJP SCJD SCWCD