Re: Forcing a JList to refresh one cell
- From: ptomblin+netnews@xxxxxxxxx (Paul Tomblin)
- Date: Wed, 25 Jan 2006 22:36:55 +0000 (UTC)
In a previous article, Vova Reznik <address@xxxxxxxx> said:
>Paul Tomblin wrote:
>> I have a JList where each item in the list is rendered by a
>> ListCellRenderer. Among other things, the ListCellRenderer shows a
>> JProgressBar that is updated by an outside event. The item itself has an
>> observer to notice that it has been updated, but other than calling
>> repaint on the whole JList, I can't seem to make it repaint the cell that
>> changed.
>>
>Look in
>javax.swing.AbstractListModel
>and its method
>protected void fireContentsChanged(Object, int, int)
>
>Practically you'll need to create your own model extends
>AbstractListModel if you don't have one.
In order to do that, the item would have to propogate the fact that it
changed up to the ListModel, and then the ListModel would have to
fireContentsChanged. I was hoping there was a direct way, but I guess
that will do.
--
Paul Tomblin <ptomblin@xxxxxxxxx> http://xcski.com/blogs/pt/
You had me at
print("Hello World\n");
.
- References:
- Forcing a JList to refresh one cell
- From: Paul Tomblin
- Re: Forcing a JList to refresh one cell
- From: Vova Reznik
- Forcing a JList to refresh one cell
- Prev by Date: Re: automatic color in JTextPane
- Next by Date: JComboBox: setting background color
- Previous by thread: Re: Forcing a JList to refresh one cell
- Next by thread: JComboBox: setting background color
- Index(es):
Relevant Pages
|
|