How to set String as static int?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12069026/java-how-to-set-string-as-static-int">Java - How to set String as static int</a>  </p>
</blockquote>



<p>I have a method that accepts only a String.</p>

<pre><code>public void setVerticalAlignment(String align) {
...
gd.verticalAlignment = align; 
// accepts only int.   
... 
} 
</code></pre>

<p>But <code>gd.verticalAlignment</code> only accepts an int. Usually this is set by something like <code>gd.verticalAlignment = SWT.TOP</code> where <code>SWT.TOP</code> is a static int.</p>

<p>is it possible to call this method with something like <code>setVerticalAlignment("SWT.TOP")</code>?</p>
