Swing is single thread so you are best to load the data from the ResultSet in a separate thread. And because it is a different thread than Swing’s Event Dispatch Thread you’ll need to ensure each entry to be added to the list is added from the EDT.
The SwingWorker class can be used to handle tasks like this.
Let us know if you’d like to see some example code.
One Response to “How to load a data from a ResultSet into a JList?”
Leave a Reply
You must be logged in to post a comment.