Selin
Selin

Reputation: 646

How can I cancel auto hiding of tooltip?

I'm working with Java and SWT on Windows OS. I created a system tray. Also, I have added tooltip to system tray. Tooltip is showing up but then it is disappearing automatically, It should appear as long as I don't press the exit button. Is it possible?

ToolTip tip = new ToolTip(shell, SWT.BALLOON | SWT.ICON_INFORMATION);
tip.setText("Title");
tip.setMessage("Test Message.");
tip.setAutoHide(false);

TrayItem trayItem = new TrayItem(tray, SWT.NONE);
trayItem.setImage(icon);
trayItem.setToolTipText("42GB");
trayItem.setToolTip(tip);
tip.setVisible(true);

Upvotes: 4

Views: 623

Answers (1)

Tonny Madsen
Tonny Madsen

Reputation: 12718

Not tested, but I believe you "just" need to remove trayItem.setToolTipText("42GB");...

Upvotes: 1

Related Questions