> i am implementing a cell renderer for a JTree which displays a set of nodes.
> The nodes in turn represent local or remote (ftp, http, etc) files.
[quoted text clipped - 8 lines]
> does not work. the 'setForeground' method is called, but nothing
> happens although the swing worker is running in the swing GUI thread.
Renderers are assumed to be stateless.
Only if the data changes will they be re-queried for an updated re-
presentation of the item they show.
Therefore, reachability of a file must be made a property of the node
in the TreeModel, which the fires nodeChanged-events when it changes.
Christian
Christian Sauer - 27 Jan 2004 07:31 GMT
Hoi christian,
the renderer itself is stateless, i know...
but the renderer creates for each rendered node an own panel containing
two labels: one with the icon and text and one with the state text. the last
one is the component of which the color should be changed according to
the files state.
cheers,
chris
> > i am implementing a cell renderer for a JTree which displays a set of nodes.
> > The nodes in turn represent local or remote (ftp, http, etc) files.
[quoted text clipped - 18 lines]
>
> Christian
Christian Kaufhold - 27 Jan 2004 13:01 GMT
Hello!
> but the renderer creates for each rendered node an own panel containing
> two labels: one with the icon and text and one with the state text. the last
> one is the component of which the color should be changed according to
> the files state.
It is still stateless. No matter how these components change later does
not matter, only their state directly after getXXXComponent.
(A renderer should probably also not create components for each node
but reuse the same once for all).
[snip reverse-time-ordered quote]
Christian