Windows 10上的通知

时间:2018-03-03 14:46:27

标签: java windows button notifications

我想要一条通知消息,其中2个按钮链接到两个不同的操作(op1和op2)(参见2°图像)。你知道我可以用来达到目标​​的任何方式(api / java class /免费的第三方应用程序)吗?

我的通知功能是

 public static void notify() throws AWTException{

    SystemTray tray = SystemTray.getSystemTray();

    Image image = Toolkit.getDefaultToolkit().createImage("");
    TrayIcon trayIcon = new TrayIcon(image);
    trayIcon.setImageAutoSize(true);
    trayIcon.setToolTip("Demo");
    tray.add(trayIcon);

    trayIcon.displayMessage("Hello, World", "notification demo", TrayIcon.MessageType.INFO);
}

这是输出

enter image description here

但我想要这样的东西

enter image description here

0 个答案:

没有答案