Check Incorrect date?

Hi, I've got written this code with some help of Sun's tutorial. But I still cannot find out why this program doesn't throw any exception when I try to enter an invalid date. What can I change so that 30/2/2004 (February 30th 2004) is incorrect?

public class Testje {

public static void main(String[] args){

Date trythis = new Date();

String test = args[0];

System.out.println("Print of the test string: " +test);

SimpleDateFormat formatter= new SimpleDateFormat ("dd/MM/yyyy");

try {

trythis = formatter.parse(test);

} catch (ParseException e) {

System.out.println("Wrong date");

e.printStackTrace();

}

String dateOut;

dateOut = formatter.format(trythis);

System.out.println(dateOut);

}

}

Thank you

[824 byte] By [ Flokky] at [2007-9-30 9:05:40]
# 1
SimpleDateFormat formatter= new SimpleDateFormat ("dd/MM/yyyy");formatter.setLenient(false);
BIJ at 2007-7-2 21:29:50 > top of Java-index,Administration Tools,Sun Connection...
# 2
BIJ0001: thank you, that worked great.What would I need to change to check the date & time?Thanks again.
Flokky at 2007-7-2 21:29:50 > top of Java-index,Administration Tools,Sun Connection...
# 3
Nevermind :)I felt totally flokky, that's why I didn't noticed I already got the answer.Thanks anyway
Flokky at 2007-7-2 21:29:50 > top of Java-index,Administration Tools,Sun Connection...