I have one OK button(push button) created.
Based on user input i want to dynamically create 1 to 10 SWT buttons(check box).
How to create it?
If OK button is clicked, how to display which are all check box button has been selected?
Please find below snippet I am trying with:
Set<String> 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?
}
}