How is a JList's contents updated when an item is added to its model?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mark_Shearman
Posted On:   Wednesday, January 9, 2002 04:28 AM

I have created a custom ListModel by extending AbstractListModel. When an item is added to the model, the JList correctly updates... however, getElementAt method is not called!


Why?!? How does it do it?


Thanks,


Mark

Re: How is a JList's contents updated when an item is added to its model?

Posted By:   Christopher_Schultz  
Posted On:   Wednesday, January 9, 2002 05:51 AM

It probably fires an event to the "View" (the JList) which contains all the information that the JList needs to display that particular entry.



The JList then does not have to turn around and call getElementAt() on your ListModel.



-chris
About | Sitemap | Contact