I am carrying out an activity and I have placed a jcalendar to my form, I want that when I select a jtable, said calendar returns to place the date that I had saved. I managed to capture this value and create a date from the strings, the year and day are correct, but the month gives me the month + 1, that is, if I put the month February 02 date_birth I will be saving the month March 03 and in turn in the jcalendar will be showing that month.
int fila = this.table_candidatos.getSelectedRow();
String fecha = elect1.getCandidatos().get(fila).getFecha_nac();
String[] tiempo = fecha.split("-");
Calendar fecha_nac = Calendar.getInstance();
fecha_nac.set(Integer.parseInt(tiempo[0]), Integer.parseInt(tiempo[1])-1, Integer.parseInt(tiempo[2]));
// System.out.println(tiempo[0] + " " + tiempo[1] + " " + tiempo[2]);
// System.out.println(fecha_nac.getTime());
this.calendar_fecha.setCalendar(fecha_nac);