简体   繁体   English

如何在swt工具提示中隐藏程序名称

[英]How to hide program name on swt tooltip

I am currently developing an application in Java using eclipse swt toolkit. 我目前正在使用eclipse swt工具包开发Java应用程序。 I am deploying my application as a jar file, which is run by the Java process. 我将我的应用程序部署为jar文件,该文件由Java进程运行。

I need to show a balloon notification, for which I am using ToolTip from SWT library. 我需要显示一个气球通知,我正在使用SWT库中的ToolTip The strange thing is, with the latest windows 10 update, the tooltip has started to show the program name at the bottom which is quite annoying. 奇怪的是,随着最新的Windows 10更新,工具提示已开始在底部显示程序名称,这非常烦人。 Since the host process is java, it shows JAVA (TM) Platform SE Binary . 由于主机进程是java,它显示了JAVA(TM)Platform SE Binary How do I go about hiding this program name/ give it my custom name? 如何隐藏此程序名称/给它我的自定义名称?

在此输入图像描述

This is how I am starting by application 这就是我从应用程序开始的方式

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

I have tried starting my program as below, giving a specific name. 我尝试启动我的程序,如下所示,给出一个特定的名称。 It doesn't help either 它也没有帮助

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

This is how I am displaying the tooltip 这就是我显示工具提示的方式

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);

You can set the name of an SWT application by calling 您可以通过调用来设置SWT应用程序的名称

Display.setAppName("app name");

You should call this as early as possible in your app, before the main readAndDispatch loop is started. 在主要的readAndDispatch循环开始之前,您应该在应用程序中尽早调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM