Date Field MIDlet Example
This example illustrates how to insert date field in your form. We are using here two fields DateField (datein and dateout) and initialize a final static variable DATE which is 0. We are taking both DateField variable in to the constructor (DateFieldExample). When application will run, first of all the startApp() method will be called and it will display the form with datein and dateout field. For the specific date we are using here java.util.Date class and java.util.TimeZone class is used to show the format of date like in figure Tue, 30 Sep, 2008.
Application display as follows:
When <date> is selected, a new window will open with a calendar as given below.
and you can select your choice of date, month and year which will appear on the form as follows.
The source code of the DateFieldExample.java is as follows: