I've written a small application for you that will do what you wanted. I've not added comments, because I think that you will be able to follow the flow quite easily and that together with the API's javadocs you will be able to understand the example without any difficulties.
Note that you can call the run the application with two different argument sets. Either by giving two dates:
This will computes the difference in days between the two days. If there's a difference in years, the answer will not be correct anymore. You could of course add a check in difference in years too, but that's up to you. The second parameter set should consist of a date and a number, with the character 'd' in front of it:
This will give the date, # days after the given date. Hopefully this will help you a bit further. Date calculations are a bit tedious, but with the above example and the previous posts, you should be able to write your application with one hand on your back.
Code Example - DateTest.java
[This message has been edited by Tim Blommerde (edited September 28, 2001).]