views:

347

answers:

1

I have a database containing a hierarchy that I want to display within a JTree.

Is there a good example/tutorial for TreeModel and/or AbstractTreeModel that explains how to implement a custom treemodel? I'm going through a lot of head-scratching and can't seem to find some code out there which is a good starting point.

edit: I did find this and this but they have no helpful comments so I'm not sure what the Firexxx methods are doing and when they get called or when I have to call them.

+1  A: 

Here is a tutorial that might help.

edit: There is a simple O'Reilly example here. And this sun tutorial as well.

akf
Thanks, but that's about JTree objects using a default built-in TreeModel, and doesn't discuss custom TreeModels at all. (the difference being the former requires a TreeNode to be present for each node in the tree. If you have an infinite or very large dataset, this is not practical w/ that approach.)
Jason S
thanks again but that's really really really basic. I need to understand the more subtle issues about event listeners, changing nodes, multithreading issues, etc.
Jason S
If I find anything else, I will post it. I guess at this point, you could start putting your code together and start asking specific questions. Good Luck.
akf
ok thanks....
Jason S