Hello I have the following code
RekeningApp app;
Persoon persoon;
JComboBox personenList;
PersoonView(RekeningApp app) {
this.app = app;
personenList = new JComboBox();
personenList.addItemListener(new ItemChangeListener());
}
Now I need a Foreach loop that goes through an arraylist filled with Persoon objects that is in the RekeninApp class.
For this arraylist I have a getter in RekeningApp like this
List<Persoon> Pers = new ArrayList<Persoon>();
public List getPersonen() {
return Pers;
}
So right after I make the combobox there must be a foreach loop only the problem is that when I make a loop It says the types are incompatible.
for (Persoon p : app.getPersonen()) {
personenList.addItem(p);
}