【问题标题】:How to hide program name on swt tooltip如何在 swt 工具提示上隐藏程序名称
【发布时间】:2018-09-20 19:38:18
【问题描述】:

我目前正在使用 eclipse swt 工具包在 Java 中开发应用程序。我将我的应用程序部署为一个 jar 文件,该文件由 Java 进程运行。

我需要显示一个气球通知,为此我使用来自 SWT 库的ToolTip。奇怪的是,随着最新的 windows 10 更新,工具提示已经开始在底部显示程序名称,这很烦人。由于宿主进程是java,它显示JAVA (TM) Platform SE Binary。我该如何隐藏这个程序名称/给它我的自定义名称?

这就是我从应用程序开始的方式

"C:\Program Files (x86)\Java\jre1.8.0_162\bin\javaw.exe" -jar "C:\Desktop\MyApplication.jar"

我尝试如下启动我的程序,并给出一个特定的名称。也无济于事

"C:\Program Files (x86)\Java\jre1.8.0_162\bin\javaw.exe" -Dname=Foobar -jar "C:\Desktop\MyApplication.jar"

这就是我显示工具提示的方式

Shell shell = new Shell(display);
tip = new ToolTip(shell, SWT.BALLOON | iconType);
tip.setAutoHide(false);
tip.setMessage(detail); //tooltip description
tip.setText(heading); // this is the title of tooltip
trayIcon.setToolTip(tip);  //this is my app tray icon
tip.setVisible(true);

【问题讨论】:

标签: java eclipse jvm swt tooltip


【解决方案1】:

您可以通过调用设置 SWT 应用程序的名称

Display.setAppName("app name");

您应该在您的应用程序中尽早调用它,在主 readAndDispatch 循环开始之前。

【讨论】:

  • 这是我在我的应用程序中做的第一件事。它没有帮助。
  • 另外,我在我的问题中添加了更多细节。希望这会有所帮助
猜你喜欢
  • 2011-03-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多