开发者

NetBeans - Programmatically Remove NotificationDisplayer Notifications

开发者 https://www.devze.com 2022-12-16 17:15 出处:网络
The NetBeans API provides the org.openide.awt.NotificationDisplayer class to create and show clickable notifications开发者_开发百科 in the main status line. For example,

The NetBeans API provides the org.openide.awt.NotificationDisplayer class to create and show clickable notifications开发者_开发百科 in the main status line. For example,

NotificationDisplayer.notify(title, icon, detailsText, detailsAction);

The user can dismiss a notification by clicking on the X; however, I would like to programmatically clear the notifications. How can I accomplish this?


The solution I end up with was to maintain a reference to the Notification object returned by the NotificationDisplayer.notify() method. The object provides a clear() method to force removal from the status line.

0

精彩评论

暂无评论...
验证码 换一张
取 消