Well, DefaultTreeCellRenderer extends JLabel, which
does let you call setText().
When the user clicks Apply, you save something
back to the database. Presumably you also change
the tree node user object at that time.
In your TreeCellRenderer, I imagine you have overriden
public Component getTreeCellRendererComponent
for the sake of your icons. In a quick and
dirty
test of this solution, I modified some
working code to look like:
in that method. The setText() is a JLabel call.
My nodes get a
String by calling getTitle() on
the user object, so I had to add some support in
that class for a new boolean, updated. I do not
allow any changes to the title field to make it
back to the database, or I could update the user
object and the db, then call
setText(item.getTitle())
instead. That might be closer to what you need.
When I ran this modified code in a rudimentary test,
I saw the node labels change to be prefaced with
Updated!
and the tree expansion did not change.
HTH,
Joe
[ January 28, 2002: Message edited by: Joe Gilvary ]