JTree and associating objects with nodes  
Author Message
Bob Creasote





PostPosted: 2003-10-28 0:32:00 Top

java-programmer, JTree and associating objects with nodes Hi,

Sorry, ignore that last post. wrong component. Does anyone know how to store
objects in a name value pair data structure (i.e. hashmap) in a JTree? It
easy to store the name of the object but to store the object with the name,
I am not sure.

Any help would be great

Thanks

Bob


 
Dieter Decavele





PostPosted: 2003-10-28 3:34:00 Top

java-programmer >> JTree and associating objects with nodes Do you mean a tree where the node with a certain name attached to it has
a value in a hashmap? Why don't you subclass DefaultMutableTreeNode
where the userobject gets loaded from the map?

Bob Creasote wrote:

> Hi,
>
> Sorry, ignore that last post. wrong component. Does anyone know how to store
> objects in a name value pair data structure (i.e. hashmap) in a JTree? It
> easy to store the name of the object but to store the object with the name,
> I am not sure.
>
> Any help would be great
>
> Thanks
>
> Bob
>
>