如何在 Mac、Java 中的 TrayIcon 中设置图像标题中的图标

发布于 2024-08-23 03:46:09 字数 370 浏览 3 评论 0原文

我创建了一个使用托盘图标的示例 java 应用程序。

trayIcon.displayMessage("Sun TrayIcon Demo",
                            "This is an error message", TrayIcon.MessageType.ERROR);

如果我使用上面的内容,那么在 Linux 和 Windows 中它会使用系统默认的错误图标,但在 Mac 中,外观和感觉是不同的。我想为标题设置图像。而不是 TrayIcon.MessageType.ERROR 我也不想更改托盘的图标。那么如何设置图标将显示在消息的标题中。

谢谢 苏尼尔·库马尔·萨胡

I have created a sample java application for using tray icon.

trayIcon.displayMessage("Sun TrayIcon Demo",
                            "This is an error message", TrayIcon.MessageType.ERROR);

If I use the above then It uses error icon of the system default in case of Linux and Windows but in Mac the look and feel is different. I want to set image for the caption. instead of TrayIcon.MessageType.ERROR also I do not want to change the icon of tray also. So how to set icon will be displayed in the caption of the message.

Thanks
Sunil Kumar Sahoo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文