> hash {
> key1 => value1,
> key2 => value2,
> keyn => valuen
> }
This is a Java, not a Perl group. If you want to write Perl code
consider using perl, not Java.
> JTree lJTree = new JTree(hash);
Use an explicit model. These constructors which take some collection are
just good for cheap hacks. The JTree is supposed to deal with
representation, not with holding data. It converts your hashtable in an
own TreeModel and forgets about the hashtable.
Your values end up in the filed childValue of instances of
javax.swing.JTree.DynamicUtilTreeNode but that field is protected and
you can't access it from the outside. The field is also ignored by the
internally build model, unless it is itself a Vector, Hashtable, or
array (Sun forgot to adapt this code to the new Collection classes a few
years ago - but no one really cares).
> I can get the keys back, but not the values, that would be really
> usefull to get them back.
Use an own model. Using the JTree(Hashtable) constructor is a bad idea.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/