Source:
ConfigurationPanelForm(boolean clearableExportDir) { this.clearableExportDir = clearableExportDir; startDatePicker = createDatePicker(); endDatePicker = createDatePicker(); $$$setupUI$$$(); startDatePicker.getSettings().setDateRangeLimits(null, LocalDate.now()); startDatePicker.setDateToToday(); startDatePicker.getSettings().setGapBeforeButtonPixels(0); startDatePicker.getComponentDateTextField().setPreferredSize(exportDirField.getPreferredSize()); startDatePicker.getComponentToggleCalendarButton().setPreferredSize(exportDirChooseButton.getPreferredSize()); endDatePicker.getSettings().setGapBeforeButtonPixels(0); endDatePicker.getComponentDateTextField().setPreferredSize(exportDirField.getPreferredSize()); endDatePicker.getComponentToggleCalendarButton().setPreferredSize(exportDirChooseButton.getPreferredSize()); endDatePicker.setEnabled(false); exportDirChooseButton.addActionListener(__ -> buildExportDirDialog().choose().ifPresent(file -> setExportDir(Paths.get(file.toURI()))) ); exportDirCleanButton.addActionListener(__ -> clearExportDir()); pemFileChooseButton.addActionListener(__ -> buildPemFileDialog().choose().ifPresent(file -> setPemFile(Paths.get(file.toURI()))) ); pemFileClearButton.addActionListener(__ -> clearPemFile()); startDatePicker.addDateChangeListener(event -> { endDatePicker.setEnabled(true); endDatePicker.getSettings().setDateRangeLimits(extractDate(event), null); setEndDate(extractDate(event)); onSelectStartDateCallbacks.forEach(consumer -> consumer.accept(extractDate(event))); }); endDatePicker.addDateChangeListener(event -> onSelectEndDateCallbacks.forEach(consumer -> consumer.accept(extractDate(event)))); }

Target:
ConfigurationPanelForm(boolean clearableExportDir) { this.clearableExportDir = clearableExportDir; startDatePicker = createDatePicker(); endDatePicker = createDatePicker(); $$$setupUI$$$(); startDatePicker.getSettings().setGapBeforeButtonPixels(0); startDatePicker.getComponentDateTextField().setPreferredSize(exportDirField.getPreferredSize()); startDatePicker.getComponentToggleCalendarButton().setPreferredSize(exportDirChooseButton.getPreferredSize()); endDatePicker.getSettings().setGapBeforeButtonPixels(0); endDatePicker.getComponentDateTextField().setPreferredSize(exportDirField.getPreferredSize()); endDatePicker.getComponentToggleCalendarButton().setPreferredSize(exportDirChooseButton.getPreferredSize()); exportDirChooseButton.addActionListener(__ -> buildExportDirDialog().choose().ifPresent(file -> setExportDir(Paths.get(file.toURI()))) ); exportDirCleanButton.addActionListener(__ -> clearExportDir()); pemFileChooseButton.addActionListener(__ -> buildPemFileDialog().choose().ifPresent(file -> setPemFile(Paths.get(file.toURI()))) ); pemFileClearButton.addActionListener(__ -> clearPemFile()); startDatePicker.addDateChangeListener(event -> { endDatePicker.getSettings().setDateRangeLimits(event.getNewDate(), null); onSelectStartDateCallbacks.forEach(consumer -> consumer.accept(event.getNewDate())); }); endDatePicker.addDateChangeListener(event -> { startDatePicker.getSettings().setDateRangeLimits(null, event.getNewDate()); onSelectEndDateCallbacks.forEach(consumer -> consumer.accept(event.getNewDate())); }); }