Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to 'refresh' a JList?

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a JList:

myJList = new JList(model); //model is a DefaultListModel
myJList.setCellRenderer(new ItemRenderer());



The JList has some items that are painted (COLOR) according to a specific parameters.
The user is able to chagne a value and as a result - the color of the item should be changed accordingly.

example
1/1/2005 abc 2/1/2005 (this is painted in red)
1/1/2005 bbc 5/1/2005 (this is painted in green)
1/1/2005 fox 7/1/2005 (this is painted in green)

When the user changes it (say he changes the date) - i need to instruct the myJList to change the color - accordingly
I thought

myJList.updateUI();

will do it but I guess i was wrong.

any idea?

Thanks
peter
 
tito bayuadji
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about repaint()?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic