Scenario
User can record their license using the application, they enter the day the license was redeemed and they also input the length of the license(days).
I am trying to figure out if you are able to calculate a new date from both these variables. for example
days = INPUT FROM USER; days = 7;
dateRedeemed = new Date(); date = 24/06/2019;
newDate = dateRedeemed + days; newDate = 01/07/2019;
//Getting the values
String name = txtName.getText();
String contact = txtContact.getText();
int years = Integer.parseInt(cboyears.getSelectedItem().toString());
int months = Integer.parseInt(cboMonths.getSelectedItem().toString());
int days = Integer.parseInt(cboDays.getSelectedItem().toString());
//Calculation
days = (years * 365) + (months * 12) + days;
SimpleDateFormat format = new SimpleDateFormat("dd/MM/YYYY");
Date dRedeemed = cboDate.getDate();
String strRedeemed = format.format(dRedeemed);
If any one could help that would be great
Edit
Some great advice in this thread, Alot of you have been pointing out that the Date class in very bad and outdated i'm now going to start using the LocalDateTime Class as that seems more powerful, Another thing i would like to ask, is there a more efficient date picker. I have been using a swingx date picker is there a more effective choice?