last Monday I attended the JayDay conference in Munich which was organized by Anton Epple and Barbara Py. I just can say that I wish all conferences would be so nice as this one was. During the day I've added another new little project to the Enzo library...notifications.
If you know Growl notifications you know what I'm talking about. In principle it's just little popups that will remind you on something or simply give you a short info about some event etc.
I thought it might be a good idea to have something like that available in JavaFX so here you go. At the moment you could either define your own notification or use one of the four predefined notifications.
A notification contains a title, a message and an icon (which is optional).
Here is some code that will show you how to use it...
// Create a custom Notification without icon
Notification info = new Notification("Title", "Info-Message");
// Show the custom notification
Notifier.INSTANCE.notify(info);
// Show a predefined Warning notification
Notifier.INSTANCE.notifyWarning("This is a warning");
As you can see this is really simple and to give you an idea about how the notifications look like, here are some images...
Notifier.INSTANCE.notifySuccess("Success"); |
Notifier.INSTANCE.notifyInfo("Information"); |
Notifier.INSTANCE.notifyError("Error"); |
Notifier.INSTANCE.notifyWarning("Warning"); |
If you create your own notification with a given image, this image will be scaled to 24 x 24px.
The styling is done by css and the styles could be found in the notifier.css file.
Here is a little video of the notification in action...
So that's it for today...enjoy your upcoming weekend and...keep coding... :)
Great looking, Gerrt. Again, too bad you're not putting this into JFXtras.
ReplyDeleteAhhh! Now i know where i knew you from.
ReplyDeleteI read your blog for a while now :)
Was a great event
Nice :)
ReplyDeleteIn Windows 8 and Windows Xp the style of the popup is different from your screenshot.Pop-ups are lighter and the text is difficult to read.
ReplyDeleteHi Daniele,
DeleteCould you send me a screenshot so that I could fix that problem for Windows?
Cheers and thanx for the info,
Gerrit
Is there a jar file out there for this? I don't personally use Gradle and I would like it if I didn't have to learn another tool just to get this. I've checked out the source code, though. It's solid as a rock. And the notifications (at least in the pictures above) look great! Awesome work!
ReplyDeleteI've added the notifications to my Enzo library which you can find on Bitbucket and bintray.
Delete