>:> In article <bspum7$7q5$03$1@news.t-online.com>,
>:> Karsten Lentzsch <Karsten@JGoodies.com> wrote:
[quoted text clipped - 41 lines]
>:
>:Dan
I don't do any server-side, so I can't say what would translate well and
what wouldn't. But here's basically what we do.
We've got a class that extends JTree. It contains two inner classes.
The first of these is used to carry information about each node on the
tree, so that it can be a fairly complex structure with references back
to the XML document that represents our data model. One of the pieces
of data it carries is its icon (and ours don't change once the nodes are
initially created).
The second inner class extends DefaultTreeCellRenderer. It really
doesn't do much except provide a method for getting access to the
underlying info structure (the instance of the other inner class) for
each node, and it has some logic to set the tooltip and set the icon
specified in that info structure.
It's important to understand that setting the icon for each node, as we
do it, uses the existing setIcon() method in DefaultTreeCellRenderer,
which takes a parameter of type Icon (an interface). Our info structure
carries an object of type ImageIcon. So we construct that object when a
node's info structure is built by combining some pre-existing images
into a single one. I didn't write this code, so I'm doing a quick
paraphrase here, but basically it reads some stored image files that are
included with our app (in this case, all are GIF), draws them to a
BufferedImage's Graphics2D, then creates a single ImageIcon object from
that combined image.
I'm not particularly graphically literate, so it's a good thing somebody
else on our team was when it came time to do some of the drawing stuff.
But that's basically how it worked out in our case.
Hope this helps.
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama