I have an app, that goes to system tray when it's minimized. And i need to show a tooltip with timer on it. Everything is ok, but i can't make tooltip refresh every when tooltip's shown. Can i refresh it somehow else, except making fake mouse event and handleing it to trick tooltip, like here, or it's the only way?
upd:
Code i'm using to set tooltip.
TrayIcon trayIcon;
SystemTray tray;
tray=SystemTray.getSystemTray();
trayIcon=new TrayIcon(image, "tooltipText");
tray.add(trayIcon);
and this one's updating the tooltip
MyClass.trayIcon.setToolTip();
TrayIcon
is bit problematic because it is not aComponent
as rest of Java AWT / Swing components. I have found workaround, but it is not exactly same as tooltip.TrayIcon
hasdisplayMessage
method that can be used instead of tooltip. I have tried to make it behave like tooltip (show on hover) but not all mouse events are supported, so message has to be shown always, or on click on icon. Also i have some concerns about implementation of message showing on other OSes. I have tested it only on MS Windows XP SP3, here is result (it is updating every 1s):Here is runnable example (you need image.jpeg to run) :