I would suggest extending the class by adding a property numLines to the
textarea - that property would take its value from the textField.numLines,
which is a protected property inside TextArea that represents the actual
textField used to render text. Then you can call TextArea.getLineMetrics()
and multiply it by the number of lines you got from numLines;

This is just from the top of my head but this looks like a good solution to
me.


2008/12/11 blc187 <[email protected]>

>   does anyone know of an existing component that can truncate multiline
> text?
>
> I'm looking to either use an already made one, or create my own
> multiline TextArea and be able to truncate when the textHeight reaches
> more than the set height of the component.
>
> So far I haven't been able to get a correct height for it, I keep
> getting a much larger height than it actually is because the
> textHeight reflects the size of the htmlText, even though I'm only
> setting text, not htmlText on it.
>
>    Is there a way to get a more accurate textHeight?
>
>  
>

Reply via email to