Java problem: Need a sorted JList to represent a database table?

Your JList s ListModel is responsible for exposing the backing data as an ordered list ListModel s methods will be called by JList from the UI (AWT event) thread, so its performance needs to be pretty good This is why most implementations have the ListModel s backing data in memory. I suppose you could implement ListModel with your database as the backing data. You'll most likely extend AbstractListModel to get the listener registration, and implement getElementAt(int) and getSize() getElementAt would then be responsible for getting the object for a particular index.

Keep in mind that JList will call getElementAt many times for different indices, so you may find yourself caching the results. Depending on how much data you're caching, you might just retrieve the entire dataset from the database.

Your JList's ListModel is responsible for exposing the backing data as an ordered list. ListModel's methods will be called by JList from the UI (AWT event) thread, so its performance needs to be pretty good. This is why most implementations have the ListModel's backing data in memory.

I suppose you could implement ListModel with your database as the backing data. You'll most likely extend AbstractListModel to get the listener registration, and implement getElementAt(int) and getSize(). GetElementAt would then be responsible for getting the object for a particular index.

Keep in mind that JList will call getElementAt many times for different indices, so you may find yourself caching the results. Depending on how much data you're caching, you might just retrieve the entire dataset from the database.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions