private JComboBox<SituationTO> getComboBoxSituations() { if (comboBoxSituations == null) { comboBoxSituations = new JComboBox<SituationTO>(); situations = frameMainListener.getAllSituatiosActive(); for (SituationTO situationTO : situations) { comboBoxSituations.addItem(situationTO); } } return comboBoxSituations; }
private void getNumberDeliveries() { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); try { Date startDate = null; Date endDate = null; startDate = simpleDateFormat.parse(getFieldStartDate().getText()); endDate = simpleDateFormat.parse(getFieldEndDate().getText()); SituationTO situationSelected = (SituationTO) comboBoxSituations.getSelectedItem(); numberDeliveries = frameMainListener.getNumberDeliveriesForProducts( startDate, endDate, situationSelected.getId()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } }