I am stuck in a programming issue. I am am making Java Application in Eclipse attached with SQlite. I want such state where user choose a date from JDateChooser and date of after two days from the specified one in JDateChooser show into next field. I am using the following code which I know works..
DateFormat df=new SimpleDateFormat("dd-MM-yyyy");
Date date = df.parse(ArrivalDate);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, 2); // Add 30 days
Date futureDate = cal.getTime();
String NextDate=df.format(futureDate);
----Here ArrivalDate is date entered by user. Issue over here is this, that Calender class choose the present date of the day. Not work with the date choose by the user. For example, if today date is 01/08/2018 and user has entered 12/08/2018.. This code will give 03/08/2018 in return, not the 14/08/2018. How do I achieve this scenario?? Kindly help.