How to refresh a JList
807599Nov 24 2006 — edited Nov 24 2006I'm making a program for my teacher which assigns lab partners.
I first make an object of DefaultListModel class and fill it with names from a text file.
Then I create a studentList object of JList class using studentModel as a parameter and a JScrollPane object from the studentList.
When the teacher presses the Shuffle button, the program reads a value from a JTextField and executes the shuffle method that many times using a for loop.
The teacher wants the program to display the List after each shuffle so that the students can see the shuffling process. My program, however, only shows the final result.
How can I make the program refresh a specific Component at a time of my choice?