title: Update swt window after adding a label
body: <p>I'm trying to implement a simple SWT dialog, which has a text field and if there is something wrong in the entered text of the text field, I want to show this error in a label at the bottom of the text field. </p>
  
  <p>So in the beginning you see only the text field, which is filling the whole window. If I show the label, I create it and want to show it at the bottom of the text field. </p>
  
  <p>My problem is, that you only see this label after resizing the window (all the same whether I make it smaller or bigger). So which method is called in the shell, when I resize the window?</p>
  
  <p>I tried:</p>
  
  <pre><code>shell.layout();
  shell.update();
  shell.pack(); 
  shell.redraw();
  textField.update();
  textField.redraw();
  </code></pre>
  
  <p>But nothing changed.</p>
  
  <p>So the only possibility that worked was to take:</p>
  
  <pre><code>Point oldSize = shell.getSize();
  oldSize.x += 1;
  shell.setSize(oldSize);
  oldSize.x -= 1;
  shell.setSize(oldSize);
  </code></pre>
  
  <p>But this is not an acceptable solution, because the user notices the small changing of the size of the shell. My question is similar to this: <a href="https://stackoverflow.com/questions/10767275/java-swt-added-label-not-visible">Java SWT added Label not visible</a> (also the application looks very similar), but in this solution with pack and setting the old size, the user notices the resizing, and this is very unsatisfying for me.</p>
  
  <p>So do you know, which method I could call to update the window, like when I resize? But in this way the size of the window stays the same?</p>
  
  <p>Thank you!</p>
  
  <p><strong>Edit:</strong> If I create the label in the beginning ans set it as invisible, you notice that there is something: 
  Example: this picture shows the window part without creating the label and setting it to invisible
  <img src="https://i.stack.imgur.com/L5k9W.png" alt="Window part without creating label and setting it to invisible"></p>
  
  <p>This picture shows the window part with creating the label and setting it to invisible:
  <img src="https://i.stack.imgur.com/1qahQ.png" alt="Window part with creating label and setting it to invisible"></p>
  
  <p>I would prefer version 1.</p>