I would like to have example on how to update a JList when I add or remove elements from a ArrayList.
The ArrayList is part of Model class. The Model class is passed to the view (which is a JPanel containing several swing components, and the JList I want to update) via its constructor. The model class is also injected in a class that reads values received from the server. When i received data from the server I add some of them to my arrayList by doing model.getArrayList().add(data). When I add data to the arrayList i would like to update the JList in my view. I would like to have help on how to link my ArrayList with my JList.