【问题标题】:How can I cancel auto hiding of tooltip?如何取消工具提示的自动隐藏?
【发布时间】:2012-10-19 07:55:03
【问题描述】:

我在 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()

标签: java swt tooltip system-tray


【解决方案1】:

未经测试,但我相信您“只”需要删除 trayItem.setToolTipText("42GB");...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-21
    • 1970-01-01
    • 2021-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多