I want to build a date widget for a form, which has a select list of months, days, years. since the list is different based on the month and year, i cant hard code it to 31
The Calendar object will tell you the number of days in the current month using getActualMaximum(Calendar.DAY_OF_MONTH). See an example here.
getActualMaximum(Calendar.DAY_OF_MONTH)
From that you can update your lists on each change.