Have Multi-line string in a JToolTipTag(s): Swing

We saw that since Swing (JDK1.2) implements simple HTML rendering for its components, it's possible to display underlined string (on JLabel or JButton for example). The same feature is true for JToolTip.
myComponent.setToolTipText
  ("<html><p>This ToolTip is</p><p>two lines</p></html>");



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]