hello everyone! If the GUI of an application has a JTextField representing date, and user can key in date in the JTextField. How to check the value key in by user is a valid date in calendar? Thanks for your answering Best Regards
If you are writing a simple application, here are a few suggestions. 1) If you have a single text field to enter the date (assuming the format is mm/dd/yyyy), you can read the year first. You can check the condition if the is entered as desired; minimum value <= year <= maximum value. If this condition is satisfied, you can check if the month and day entered is valid. java.util.Calendar provides with methods like getActualMinimum and getActualMaximum which you can use to check the validity of entered field. 2) A better solution is to provide a combobox from where the user can make his selection.
Don't touch me. And dont' touch this tiny ad:
how do I do my own kindle-like thing - without amazon