This data field class was created by extending the java swing JTextField class. The field has several user friendly features. For example, if the required date is the 5th of the pesent month and year, simply enter the day (e.g. 5) and the rest of the date will be filled in (e.g. 05-07-2000). This is also true for other partial dates that are entered (e.g. 5-4). If the date is not valid, for example there are to many days in the selected month, a user friendly error message is generated by highlighting the part of the date that is incorrect (e.g. 33-03-2000 would be displayed with the 33 highlighted).
With some databases, such as DB2, the date field is entered as YYYY-MM-DD. If this is required the getText method is replaced with the getDate() method. The get and set Date methods automatically convert to and from the DB2 database format. This further encapsulates the date field functionality. The data field also has a Boolean isValid() method. This can be used to check the validity of a date prior to it being sent to a database. If an invalid date is present a descriptive message is displayed in a message box.