B4J Library jNotifications - Simple tray notifications (Class)

Hello,

This is a class I wrote that creates a simple pop-up notification at the bottom of the screen. It's animated and can be fully customized.

At the moment, only one position is supported, which is at the bottom right of the screen.

Features:
  • Set custom text and background colors
  • Set a custom title and message
  • animation, toast style (non linear animation, slowing down)
  • Set custom Icon
  • 2 events can be retrieved, 1) when the user clicks the [X] button, 2) when the user clicks the notification
  • Can set the offset from the border of the screen manually
Capture2.JPG
Capture.JPG


[Edit] Minimum Java 8u20
  • Notification will stay on top of other windows
  • Fixed a possible bug
  • Added the events so that they show in the event list when creating a new sub.
  • Event "_Closed" and "Action" are now called with a delay (callsubdelayed)
[Edit] Added new methods:
  • MessageColor
  • TitleColor
[Edit] Added library description to first post and some thumbnail images.

[Edit] Modified the library a bit, with script breaking changes:
  • Renamed the method: "Text" ( and setText) to "Message", so it is now clearer
 

Attachments

  • jNotifications.zip
    9.5 KB · Views: 616
  • jNotifications_Jar.zip
    5.8 KB · Views: 555
Last edited:

jmon

Well-Known Member
Licensed User
Longtime User
Updated the library.

Minimum Java 8u20
  • Notification will stay on top of other windows
  • Fixed a possible bug
  • Added the events so that they show in the event list when creating a new sub.
  • Event "_Closed" and "Action" are now called with a delay (callsubdelayed)
 

ab3d

Member
Hello,

This is a class I wrote that creates a simple pop-up notification at the bottom of the screen. It's animated and can be fully customized.

At the moment, only one position is supported, which is at the bottom right of the screen.

Features:
  • Set custom text and background colors
  • Set a custom title and message
  • animation, toast style (non linear animation, slowing down)
  • Set custom Icon
  • 2 events can be retrieved, 1) when the user clicks the [X] button, 2) when the user clicks the notification
  • Can set the offset from the border of the screen manually
View attachment 22739 View attachment 22740

does this library has any specific requirement other than JavaObject Library? i used jNotification Library but it errors. the error says "java.io.FileNotFoundException: jNotifications.bjl". why?
 

jmon

Well-Known Member
Licensed User
Longtime User
does this library has any specific requirement other than JavaObject Library? i used jNotification Library but it errors. the error says "java.io.FileNotFoundException: jNotifications.bjl". why?
Yes, you need to copy thr BJL file in the files folder to your files folder.
 

ab3d

Member
Yes, you need to copy thr BJL file in the files folder to your files folder.
thank for your reply. :) it solves the problem in debug mode but same error happens in release mode! why the file format is .fxml but error say .bjl?
 

jmon

Well-Known Member
Licensed User
Longtime User
This class was done a few years ago when the b4jdesigner didn't exist. So I was using Java Fx Scene Builder to make the layout of this notification.

Once you have copied the bjl file to your files folder, make sure you press the "sync" button in your files tab (in b4j), so that it's packed with your jar iin release mode.
 
Last edited:
Top