public void setDate(String strYear, String strMonth, String strDay) throws java.text.ParseException {
//valid input
int year,month,day;
try {
year=Integer.parseInt(strYear);
month=Integer.parseInt(strMonth);
day=Integer.parseInt(strDay);
} catch (Exception e) {
throw new java.text.ParseException("Not a Valid Input!",0);
}
//backup
Date oldDate=cal.getTime();
setYear(year);
setMonth(month);
setDay(day);
if(getYear()!=year || getMonth()!=month || getDay()!=day){
cal.setTime(oldDate);
throw new java.text.ParseException("Not a Valid Input! maybe input is out of bound",0);
}
}