Since most of the methods in the Date class are deprecated, you can use java.util.Calendar.
Calendar firstCalendar = Calendar.getInstance();
firstCalendar.setTime(firstDate); //set the time as the first java.util.Date
Calendar secondCalendar = Calender.getInstance();
secondCalendar.setTime(secondDate); //set the time as the second java.util.Date
int year = Calendar.YEAR;
int month = Calendar.MONTH;
int difference = secondCalendar.get(year) - firstCalendar.get(year);
if (difference > 0 && 
    (secondCalendar.get(month) < firstCalendar.get(month))) {
    difference--;
} 
With the if statement I'm checking if we have dates like June, 2011 and March, 2012 (for which the whole year difference would be 0). Of course, I'm assuming that secondDate is after firstDate.