0

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.

Jason S
  • 184,598
  • 164
  • 608
  • 970

1 Answers1

1

Here is a tutorial that might help.

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

DRCB
  • 2,111
  • 13
  • 21
akf
  • 38,619
  • 8
  • 86
  • 96
  • 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 Jul 31 '09 at 15:57
  • 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 Jul 31 '09 at 16:13
  • 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 Jul 31 '09 at 16:21