Multi-line tooltips in Java?

Amanda S picture Amanda S · May 15, 2009 · Viewed 61.5k times · Source

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

Answer

Paul Tomblin picture Paul Tomblin · May 15, 2009

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.

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