title: How to center a Button using a FormLayout in SWT?
body: <p>How can I position a <code>Button</code> (vertically) at the center using a <code>FormLayout</code> (see <a href="http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html" rel="nofollow noreferrer">here</a>)? Using:</p>
  
  <pre><code>final Button button = new Button(shell, SWT.NONE);
  button.setText("Button");
  
  final FormData layoutData = new FormData();
  layoutData.top = new FormAttachment(50);
  layoutData.left = new FormAttachment(0);
  layoutData.right = new FormAttachment(100);
  button.setLayoutData(layoutData);
  </code></pre>
  
  <p>I end up with </p>
  
  <p><img src="https://i.stack.imgur.com/3sXqy.png" alt="enter image description here"></p>
  
  <p>Which is not surprising, since I told it to put the top of the button at the center (<code>layoutData.top = new FormAttachment(50);</code>). How can I instead put the center of the button at the center?</p>