简体   繁体   English

Java 9中的OSX下的Dock图标

[英]Dock icon under OSX in Java 9

I am trying to set the Dock icon in Java 9. 我想在Java 9中设置Dock图标。

With previous versions of Java this was possible with something like com.apple.eawt.Application.getApplication().setDockIconImage(image); 使用以前版本的Java,可以使用com.apple.eawt.Application.getApplication().setDockIconImage(image); but unfortunately with Java 9 the Application class is obsolete and inaccesible (maybe also missing?). 但不幸的是,在Java 9中,Application类已经过时且无法访问(也许还缺少?)。

For all other tasks found in Application class, the java.awt.Desktop class took this functionality, all but the Dock manipulation. 对于Application类中的所有其他任务, java.awt.Desktop类采用了此功能,除Dock操作外。

In JEP 272 this change is mentioned, as well as the idea that Dock is too much Apple-oriented (for me all are Apple oriented) and there is no clear explanation about it. JEP 272中提到了这种变化,以及Dock太过于苹果导向的想法(对我来说都是面向Apple的)并且没有明确的解释。

A Google search also has pre-9 information on how to deal with this. Google搜索还提供了有关如何处理此问题的9前信息。

Does anyone have any idea how's done now with Java 9? 有没有人知道现在如何使用Java 9?

你在新的java.awt.Taskbar类中尝试过setIconImage吗?

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

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