4
我正在使用Windows和Windows上的Java和SWT。我創建了一個系統托盤。另外,我已將工具提示添加到系統托盤。工具提示正在顯示,但隨後會自動消失,只要我不按下退出按鈕,它就會出現。可能嗎?如何取消自動隱藏工具提示?
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);
是您'tray'變量設置爲'display.getSystemTray()'? – Secko