我将代码从jdk 1.6转换为jdk 1.5,代码为:

import java.awt.SystemTray;

public static void main(String[] args) {
    if (SystemTray.isSupported()) {
        SystemTray tray = SystemTray.getSystemTray();
    }

    try {
       tray.add(trayIcon);
    } catch (AWTException e) {
       System.err.println("TrayIcon could not be added.");
    }
}


你们能告诉我与此兼容的代码是什么吗?

最佳答案

您可以尝试其中任何一个

JDIC (JDesktop Integration Components)

JTray

10-02 05:50