0

I am searching for a small week now for this little problem;

  1. I want (the user) to input a date in JDateChooser or JTextField, but im not sure if that works with calendar value in the JTextField.

  2. Add 3 month and 45 days to it (to the user given date).

  3. Display the the calculation on the screen (with System.out.printn or JLabel).

example. user inputs (01-04-2010) add months/days(3 months, 45 days) output on the screen (15-08-2010).

i cant find any tutorial about this :( Hope someone can help me a little bit further

Koen2K
  • 1
  • 3
  • Can you please share the code you've already written so we can see what are are doing right and/or wrong? – mba12 Nov 30 '16 at 17:31
  • `Calendar cal = Calendar.getTime (dateChooserCombo1); cal.add (Calendar.MONTH, + 3); cal.add(Calendar.DATE, + 45); System.out.println("new date:" + (cal));` – Koen2K Nov 30 '16 at 18:19
  • I think you'll find what you need here: http://stackoverflow.com/questions/10118327/addition-and-subtraction-of-dates-in-java – mba12 Nov 30 '16 at 18:25
  • Thank you very much, i think i can figure it out for now. – Koen2K Nov 30 '16 at 18:47

0 Answers0