• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. SWT Trees > Adding Items to Other Items

13.3. Adding Items to Other Items

If you think of the Windows Explorer interface as the design you are mimicking, you know that there are two types of items—those attached directly to the tree and those that appear beneath other items when the higher-level items are expanded. These subitems in the tree hierarchy are created with additional TreeItem objects that are attached to the higher-level TreeItem that serves as the parent.

13.3.1. How do I do that?

To create items that are children of another item, pass the TreeItem constructor a reference to the TreeItem that you wish to serve as the parent item, a style, and the position in which you want the child item to appear:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint