code: private static void setOneWithTwoButtonClicked(ActionEvent e) {
          // Set date from date picker 2.
          LocalDate datePicker2Date = datePicker2.getDate();
          datePicker1.setDate(datePicker2Date);
          // Display message.
          String message = "The datePicker1 date was set using the datePicker2 date!\n\n";
          message += getDatePickerOneDateText();
          panel.messageTextArea.setText(message);
      }
docs: setOneWithTwoButtonClicked, This sets the date in date picker one, to whatever date is
  currently set in date picker two.