Java中的多行工具提示?

问题描述:

我正在尝试在Java中显示工具提示,这可能是段落长度,也可能不是。如何自动换行长工具提示?

I'm trying to display tooltips in Java which may or may not be paragraph-length. How can I word-wrap long tooltips?

如果您将工具提示包装在< html>中< / html> 标记,您可以使用< br> 打破行标签。请参阅 http://www.jguru.com/faq/view.jsp?EID = 10653 的例子和讨论。

If you wrap the tooltip in <html> and </html> tags, you can break lines with <br> tags. See http://www.jguru.com/faq/view.jsp?EID=10653 for examples and discussion.

或者你可以使用网上很多地方可以找到的JMultiLineToolTip类,包括
https://github.com/ls-cwi/yoshiko -app / blob / master / src / main / java / com / yoshiko / internal / view / JMultiLineToolTip.java

Or you can use the JMultiLineToolTip class that can be found many places on the net, including https://github.com/ls-cwi/yoshiko-app/blob/master/src/main/java/com/yoshiko/internal/view/JMultiLineToolTip.java