I have this method that sets my JList of days to each Day object in my ArrayList
public void setCalender(ArrayList<Day> calender) {
this.calender = calender;
listDays.setListData(this.calender.toArray());
}
Each day contains 3 Period objects. Currently the list renders as:
Day1
Day2
Day3
However I want the user to also be able to select a period, by rendering
Day1: Period1
Day1: Period2
Day1: Period3
Day2: Period1
Day3: Period2
Day3: Period3
..and so on. How can I achieve this?
Assuming you have a method like
getPeriods()which returns the period list of a specific day, you can use this code: