Hi!

When my combobox changes object, the Jlist that is set to change depending on which object is selected, doesn't change but instead just freezes the Jlist.

Edit: only the default selected object has it's DefaultListModel do what it's supposed.

here's the code

Java Code:
final JComboBox cb = new JComboBox(Personlista.Personlista);
    
    Person selected = (Person)cb.getSelectedItem();
    LanlistModel = selected.getList();
    lanlist = new JList(LanlistModel);
Java Code:
  cb.addItemListener(new ItemListener(){

		@Override
		public void itemStateChanged(ItemEvent e) {
			Person selected = (Person)cb.getSelectedItem();
	        LanlistModel = selected.getList();
		}
		        });

Java Code:
	public void setList(DefaultListModel list) {
		this.list = list;
	}

	public DefaultListModel getList() {
		return list;