How can I cancel the automatic hiding of the tooltip?

I work with Java and SWT on Windows. I created a system tray. In addition, I added a tooltip to the system tray. A tooltip appears, but then disappears automatically. It should appear until I 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); 
+4
source share
1 answer

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

+1
source

Source: https://habr.com/ru/post/1440723/


All Articles