private String getMenuList(ScheduledEventPost event) { String list = ""; int i = 1; for (MenuType menu : event.getMenuList().getMenuList()) { list += menu.getFoodType(); if (event.getMenuList().getMenuList().size() > i) { list += ", "; } i++; } return list; }
public void populateTable() { DefaultTableModel model = (DefaultTableModel) tblEvents.getModel(); model.setRowCount(0); for (JobRequest request : coordOrg.getJobQueue().getJobRequestList()) { Object row[] = new Object[5]; ScheduledEventPost event = (ScheduledEventPost) request; row[0] = event; row[1] = new java.text.SimpleDateFormat("MM/dd/yyyy").format(request.getTaskScheduleDate()); row[2] = event.getStatus(); row[3] = getMenuList(event); row[4] = 2 + event.getAttendanceList().size(); model.addRow(row); } }