The Java Tutorials' Weblog

pageicon Thursday Jun 21, 2007

Input Requested for How to Use Trees Page

I am updating the How to Use Trees page of the Components lesson. We would like to beef up the Creating a Data Model section, preferably, exploring more of the 'Genealogy model'. The existing example on Genealogy is contributed by one of the Tutorial readers. Here is a chance for you to contribute more to this topic.

Also, we would like to include one more topic on 'How to implement a model that lazily loads children'. Any thoughts or suggestions?

- Jacob Royal

Comments:

Trees, my favorites. I would love to see a section on attaching pop-up menus to trees. How one would attach, and how i can have different menus depending on the node it was clicked on.

Posted by Viswanath on June 24, 2007 at 10:35 AM PDT #

Slightly out of scope, but recently I was doing a tree project where I wanted to model a threaded discussion. Putting each comment as a child node worked fairly well, but I also wanted the ability to collapse the comment without collapsing the subtree at that location (for example, to show only new comments).

JTree made this extremely difficult because it did not want to let me assign actions to my node objects. I found a workaround, but the coding required was ugly (or maybe I just write ugly code).

Any help in such a specific requirement would be nice. ;-)

Oh, and clear explanations of the tree jargon would be WONDERFUL. It is not often clear what the difference is between a node, a child, a leaf, and the methods that count or traverse those.

While I'm at it, a clear and concise explanation of the tree model, and how to get to the data you want, is much to be desired. The idea that tree elements are simply treated as rows was NOT clear at all the first hundred times I read the old tutorial. This has great impact on knowing what I want to display.

Posted by Naruki on July 05, 2007 at 06:41 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 903