File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set next line in ToolTip
 
Similar Threads
Adding Tooltip to JTable header
Hover over results in seeing text in background
Problem in Tooltip
How can I build a custom image tooltip ?
Tooltip on Line2D or Rectangle2D