-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebNotificationPopup for JApplet #125
Comments
Since you are using an applet there are no active windows in the application by default and PopupManager cannot automatically find a parent for your notification. So you have to provide it manually in WebNotificationPopup popup = new WebNotificationPopup ( NotificationStyle.mac );
popup.setContent ( msg );
popup.setIcon ( icon );
popup.setDisplayTime ( timeout );
NotificationManager.showNotification ( myApplet, popup ); This way it should work. |
I have added a small improvements for the exceptions thrown in this case. Anyway, notification should be displayed properly if you will use the method I recommended. |
Thank you so much mgarin. You're awesome!! |
Always welcome :) |
How can I have Notification popups for a JApplet?
WebNotificationPopup popup = new WebNotificationPopup(NotificationStyle.mac);
popup.setContent(msg);
popup.setIcon(icon);
popup.setDisplayTime(timeout);
NotificationManager.showNotification(popup);
I am calling this inside Japplet and I get the following error:
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at com.alee.managers.popup.PopupManager.getPopupLayer(PopupManager.java:226)
at com.alee.managers.popup.PopupManager.getPopupLayer(PopupManager.java:209)
at com.alee.managers.notification.NotificationManager.showNotification(NotificationManager.java:494)
at com.alee.managers.notification.NotificationManager.showNotification(NotificationManager.java:482)
Not sure if it is designed to work with JApplet.
The text was updated successfully, but these errors were encountered: