答案 0 :(得分:1)
您可以使用TaskBar
和TaskItem
类执行此操作,但它可能无法在所有平台上运行。
TaskBar taskBar = Display.getDefault().getSystemTaskBar();
// TODO may return null if not supported on the platform
// Get application item
TaskItem taskItem = taskBar.getItem(null);
if (taskItem != null)
taskItem.setOverlayText("your text");
还可以尝试:
TaskItem taskItem = taskBar.getItem(shell);
其中shell
是您的主应用程序shell。 TaskItem
JavaDoc建议尝试两种方法来获取TaskItem
:
为了获得更好的跨平台支持,首先应该使用应用程序代码 尝试在主要shell的TaskItem上设置此功能,然后在 应用程序的TaskItem。