label.setToolTipText("<html><p width=\"350\">" + text.toUpperCase() + "</p></html>") in java SWT not working

huangapple 未分类评论50阅读模式
英文:

label.setToolTipText("<html><p width=\"350\">" + text.toUpperCase() + "</p></html>") in java SWT not working

问题

我希望当提示信息的宽度超过最大宽度,例如350个字符时,能够显示多行提示信息。

Label label = new Label(this.wfSummaryComposite, SWT.NONE);
String text = "文本内容超过350个字符";
label.setToolTipText("<html><p width=\"350\">" + text.toUpperCase() + "</p></html>");

我添加了这段代码,但它没有生效。

英文:

I want to display my tooltip in multiple lines when it crosse max width for ex: 350 characters.

Label label = new Label(this.wfSummaryComposite, SWT.NONE);
String text = &quot;Text which has more than 350 characters&quot;
label.setToolTipText(&quot;&lt;html&gt;&lt;p width=\&quot;350\&quot;&gt;&quot; + text.toUpperCase() + &quot;&lt;/p&gt;&lt;/html&gt;&quot;)

I added this code but it not working.

huangapple
  • 本文由 发表于 2020年5月5日 15:58:04
  • 转载请务必保留本文链接:https://java.coder-hub.com/61608377.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定