You could also use the TextMetrics class to measure a block of text to see how big you should size the TextArea. Controlling both height *and* width* could be tricky - a string without line breaks could be 10000px wide and only 25px tall, or could be 100px wide and 2500px tall, plus or minus word breaks. You'll need to set some constraints, or assume line breaks.
Textarea is wrapping off the line which I don't want. Instead I want a horizontal scroll bar I line exceeds textarea's width. I tried textarea.getElement().setAttribute("wrap","off") but its not working. Same is working for gwt's textarea.
Finally, the GXT Textarea consists of more than just a <textarea> element (in order to make things like validation messages be drawn), so calling getElement() returns the 'wrong' element - the parent of the actual <textarea>. This means that you aren't setting that attribute on the correct element. Additionally, each time the value changes, the contents will be redrawn - the original html (the template in the appearance) must be modified or the setAttribute call must be run every time the widget re-renders. Note that properly written CSS should not have this issue.