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

Chapter 8. The SWT Combo > Adding Events to Combo Widgets

8.7. Adding Events to Combo Widgets

There are times when you must take an action immediately after the user selects something in a Combo. Perhaps the most frequent example is when you want to populate a second Combo (or List) based on the selection the user makes in the first Combo.

8.7.1. How do I do that?

Like List, the Combo can listen for and respond to an event fired when the user makes a selection from the list. To accomplish this task, you use a SelectionListener. Consider Example 8-2, which creates two Combo objects, then populates the second based upon the item selected by the user in the first.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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