This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Newlines not shown when using trayicons on Ububtu 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 » Java in General
Bookmark "Newlines not shown when using trayicons on Ububtu" Watch "Newlines not shown when using trayicons on Ububtu" New topic
Author

Newlines not shown when using trayicons on Ububtu

Jonathan Culloty
Greenhorn

Joined: Apr 22, 2006
Posts: 16
A bit of an obscure problem here but someone might have an idea...

I've a multiplatform app that displays some info in the system tray...
When a user hovers the mouse over the tray icon a tooltip is displayed.
The info in my tooltip requires newlines to make it readable...
Windows and OSX have no problem with the newlines, but newlines are not shown in the tooltip when I'm running on ubuntu.
My code looks something like this...

Anyone have any suggestions, this is driving me mad :-)
Thanks,
Jonathan
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37926
    
  22
Don't know. You could try using the String.format method and %n, but I suspect that will simply convert to \n, in which case it will make no difference.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

1) Try inserting a space between "\n" and Result
2) Consider using html for tool tips.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jonathan Culloty
Greenhorn

Joined: Apr 22, 2006
Posts: 16
Thanks for the suggestions guys, I tried using HTML to format it but its not supported for trayicon tooltips.
Its only supported for normal graphics...
Space between \n and Result did help either..

I'll try String.format later but I suspect it'll be the same result.

Cheers,
Jon
 
wood burning stoves
 
subject: Newlines not shown when using trayicons on Ububtu
 
Similar Threads
TrayIcon after explorer crash
tray icon is not displaying
TrayIconDemo on VISTA
How to Add a Systemtray Icon on several machines ?
Error loading image jar