Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to refresh a JList

807599Nov 24 2006 — edited Nov 24 2006
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2006
Added on Nov 24 2006
6 comments
1,698 views