I am in need of your help once again! I have a list and a custom list model. The data in my list model is loaded on a separate thread in order to improve the responsiveness of the list. This makes the data come down in trickles as it tries to fetch it from the database. I have DataChangedListener installed and so whenever new data comes into the model, I call <listener>.dataChanged(DataChangedListner.ADDED, idx). However, the list does not get redrawn automatically as new items are added but if I scroll on the list, it gets redrawn and the new data from the model gets shown on the list.
So the question is, should the list refresh be handled by my code manually every time the model changes? If so, what is the best way to do this? Setting the model again seemed to work (i.e. list.setModel(model)) as well as repainting the list but I am not sure if that is the right way of doing it as it sometimes does not resize the list to the correct size.
Many many thanks!