my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes How to set next line in ToolTip Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set next line in ToolTip" Watch "How to set next line in ToolTip" New topic
Author

How to set next line in ToolTip

Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
Hi all,

i have set tooltip for each item of the JList.

everything is ok.

But the problem with setToolTipText(String s) method is that it
shows everything in one single line ,how long it may be.

i tried using '\n' after some characters but it doesnot worked

Can anybody help me out.
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
You can use HTML markup in the tooltips, so you could have

<HTML>Something<br>somethingelse</HTML>

(Where <br> is the new line)

Cheers,
Rachel
Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
Thanks it worked!!!
 
jQuery in Action, 2nd edition
 
subject: How to set next line in ToolTip
 
Similar Threads
Adding Tooltip to JTable header
Tooltip on Line2D or Rectangle2D
How can I build a custom image tooltip ?
Hover over results in seeing text in background
Problem in Tooltip