title: How to dynamically create SWT buttons and their actions?
body: <p>I have one OK button(push button) created.</p>
  
  <p>Based on user input i want to dynamically create 1 to 10 SWT buttons(check box).</p>
  
  <p>How to create it?</p>
  
  <p>If OK button is clicked, how to display which are all check box button has been selected?</p>
  
  <p>Please find below snippet I am trying with:</p>
  
  <pre><code>Set&lt;String&gt; Groups = getData(Contents);
  for(String group : contentGroups) {
  
  contentButton = new Button(fComposite, SWT.CHECK);  
  
      // is this right way to create dynamic buttons?
  
      contentButton.setText(group);
  
  }
  
  okButton = new Button(lowComposite, SWT.PUSH);
  
  okButton.addSelectionListener(new SelectionListener(){
  
      @Override
      public void widgetSelected(SelectionEvent e){
  
          //Here how to get the selection status of contentButtons?       
      }
  }
  </code></pre>