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

Chapter 8. The SWT Combo > Getting and Setting Text in the Text Portion of the ...

8.9. Getting and Setting Text in the Text Portion of the Combo

You have already worked with getText( ) and setText( ) in the preceding sections, but that was in the context of an SWT.READ_ONLY combo. In an SWT.DROP_DOWN style combo, setText( ) works a little differently and bears re-examination.

In the preceding examples, setText( ) was used as a method of selecting an item in the list portion of the combo. With a SWT.READ_ONLY combo, that approach works fine, but in an SWT.DROP_DOWN-style combo, that approach no longer works. When you perform a setText( ) action on an SWT.DROP_DOWN combo, the text portion of the combo will reflect the change, but you must take an additional action to force an item to actually become selected.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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