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

Chapter 7. SWT Lists > Adding Items to a List

7.2. Adding Items to a List

You can use the setItems() method to add items to a list with only a single method call. This keeps code clutter to a minimum and makes for cleaner implementation.

7.2.1. How do I do that?

To populate the list with only a single method call, you must first create an array of String objects that hold the items to be added:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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