title: How to dynamically create an SWT Text based on a combo selection
body: <p>I have a Combo and a text widget in my dialog. When the dialog is initially loaded i only want the combo to be present , but based on a combo selection i want the Text to be displayed.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>public class NewDialog extends Dialog 
  {
  private Label label1;
  private Combo combo;
  
  private Label label2;
  private Text text;
  
  private Composite container;
  
  public NewDialog(Shell parentShell) {
      super(parentShell);
  }
  
  @Override
  protected Control createDialogArea(Composite parent) 
  {
      container = (Composite) super.createDialogArea(parent);
      GridLayout gridLayout = (GridLayout) container.getLayout();
      gridLayout.numColumns = 3;
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
  
      label1 = new Label(container, SWT.NONE);
      label1.setText("Class");
  
      combo = new Combo(container, SWT.NONE);
      GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
      gd_combo.widthHint = 165;
      combo.setLayoutData(gd_combo);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
      new Label(container, SWT.NONE);
  
      combo.add("One");
      combo.add("Two");
      combo.add("Three");
  
  
      combo.addSelectionListener(new SelectionAdapter()
      {
          public void widgetSelected(SelectionEvent event)
          {
              if(combo.getText().equals("One"))
              {
                  label2 = new Label(container, SWT.NONE);
                  label2.setText("Name");
  
  
                  text = new Text(container, SWT.BORDER);
                  GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
                  gd_text.widthHint = 239;
                  text.setLayoutData(gd_text);
              }
  
          }
      });
  
      return container;
  }
  </code></pre>
  
  <p>Im not getting the Text displayed in the dialog based on the combo selection.</p>
  
  <p>Please let me know where im going wrong</p>