use of org.openide.awt.Notification in project almond by trixon.
the class NotifocationHelper method displayTextNotification.
public static void displayTextNotification(String title, String text, int autoCloseDelayMilliSeconds) {
ImageIcon icon = ImageUtilities.loadImageIcon("se/trixon/almond/nbp/res/null.png", true);
final Notification notification = NotificationDisplayer.getDefault().notify(title, icon, text, null);
if (autoCloseDelayMilliSeconds > 0) {
Runnable task = new Runnable() {
@Override
public void run() {
notification.clear();
}
};
sSCHEDULED_EXECUTOR_SERVICE.schedule(task, autoCloseDelayMilliSeconds, TimeUnit.MILLISECONDS);
}
}
Aggregations