开发者

NetBeans - Programmatically Remove NotificationDisplayer Notifications

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜