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

Chapter 6. SWT Buttons > Adding Listeners to CHECK Buttons

6.5. Adding Listeners to CHECK Buttons

On a few occasions it will be necessary to add a Listener to an SWT.CHECK-style button. One instance when this is required is when you want to populate a List or Combo with items depend on which button is checked.

6.5.1. How do I do that?

The following code adds a SelectionListener to the SWT.CHECK buttons created in the section "Creating Check Buttons" and, in the widgetSelected() method, determines the state of the button at the time the button is clicked:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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