如何在GWT标签小部件中格式化文本

[英]How can I format text in GWT label widget


I would like to break a long line of text assigned to the standard Label widget in GWT. I was experimenting with inline <br /> elements but with no success.

我想打破分配给GWT中标准Label小部件的长行文本。我正在尝试使用内联
元素,但没有成功。

Something like this:

像这样的东西:

label = "My very very very long<br />long long text"

2 个解决方案

#1


17  

You need to use the HTML widget, which extends the standard Label widget, and adds support for interpreting HTML tags.

您需要使用扩展标准Label小部件的HTML小部件,并添加对解释HTML标记的支持。

See the JavaDoc.

请参阅JavaDoc。

#2


2  

I would use CSS to style the label to fit a given with and drop the <br/> all together.

我会使用CSS来设置标签的样式以适合给定的并将所有内容放在一起。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2008/10/17/6b397f98d2ae4a0938d7764bd98cac50.html



 
  © 2014-2022 ITdaan.com 联系我们: