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

Chapter 7. SWT Lists > Inserting Items in the Middle of a List

7.3. Inserting Items in the Middle of a List

Sometimes it is necessary to add items to a list that has already been populated. At such times, you often need to cause new items to appear in the middle of the list, instead of adding them to the end.

7.3.1. How do I do that?

There are two versions of the add() method. As you saw in Example 7-1, the first version appends items to the list in the order in which the method is called. Each successive add causes the item to appear at the bottom of the list.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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