コード例 #1
0
  private void setNextRepetitionDate(LocalDate nextRepetitionDate) {
    String formattedNextRepetitionDate =
        nextRepetitionDate.format(DateTimeFormatter.ofPattern("dd.MM.yyyy"));

    nextRepetitionDateTextField.setText(formattedNextRepetitionDate);
    setNextRepetitionDateForeground(nextRepetitionDate);
  }
コード例 #2
0
 private void setNextRepetitionDateForeground(LocalDate nextRepetitionDate) {
   if (nextRepetitionDate.isAfter(LocalDate.now()))
     nextRepetitionDateTextField.setForeground(NEXT_REPETITION_DATE_DEFAULT_FOREGROUND);
   else nextRepetitionDateTextField.setForeground(NEXT_REPETITION_DATE_BEFORE_TODAY_FOREGROUND);
 }