B4J Question jNotification library on B4XPages

max123

Well-Known Member
Licensed User
Longtime User
Hi all,

I want to use a good jNotification library from @jmon on top of B4XPages but it always crash in compilation on the initializer line.

This is my simple code:
B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
  
    Private Notif As jNotifications
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
       Root = Root1
    Root.LoadLayout("MainPage")
    B4XPages.SetTitle(Me,"AppTitle")
    Root.Color = xui.Color_RGB(40,40,40)
  
   'Initialize the Notifications
    Dim frm As Form = B4XPages.GetNativeParent(Me)
    Notif.Initialize(Me, "Notif", frm)  ' <<< Compilation crash on this line

    Notif.Image = fx.LoadImageSample(File.DirAssets, "pad1_lores.jpg", 80, 40)
    Notif.setOffset(25, 25)
  
    Notif.Title = "Server is running ..."
    Notif.Message ="blablabla"
    Notif.SpeedMultiplier = 1
    Notif.Duration = 5 'Note that duration can be set to 0 = infinite.
    Notif.BackColor = fx.Colors.Cyan
    Notif.TitleColor = fx.Colors.red
    Notif.MessageColor = fx.Colors.White
  
    Log("Duration: " & Notif.Duration & " seconds.")
    Log("Speed multiplier: x" & Notif.SpeedMultiplier)

    Notif.Show
End Sub

I even tried to move the declaration and initialization on the Main and initialize this way in AppStart sub, but nothing changed, I have always the same error:
B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.Show 
  
    Notif.Initialize(Me, "Notif", MainForm)
  
    Dim PagesManager As B4XPagesManager
    PagesManager.Initialize(MainForm)
End Sub

Here the long error log.... Please where I'm wrong ? It expects an AnchorPane ?
Many thanks
Waiting for debugger to connect...
Program started.
java.lang.NoSuchMethodError: anywheresoftware.b4j.objects.PaneWrapper$AnchorPaneWrapper.LoadLayout(Lanywheresoftware/b4a/BA;Ljava/lang/String;)V
at b4j.example.jnotifications._initialize(jnotifications.java:287)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:673)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:64)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:145)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:115)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:81)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:486)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:872)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:351)
at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:172)
at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:186)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:122)
at b4j.example.main._appstart(main.java:80)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:38)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Error occurred on line: 109 (B4XMainPage)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:486)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:872)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:351)
at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:172)
at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:186)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:122)
at b4j.example.main._appstart(main.java:80)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:38)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:134)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:81)
... 35 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:115)
... 36 more
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: anywheresoftware.b4j.objects.PaneWrapper$AnchorPaneWrapper.LoadLayout(Lanywheresoftware/b4a/BA;Ljava/lang/String;)V
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:64)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:145)
... 41 more
Caused by: java.lang.NoSuchMethodError: anywheresoftware.b4j.objects.PaneWrapper$AnchorPaneWrapper.LoadLayout(Lanywheresoftware/b4a/BA;Ljava/lang/String;)V
at b4j.example.jnotifications._initialize(jnotifications.java:287)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:673)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
... 44 more
An error occurred:
(Line: 111) 111
java.lang.Exception: array not expected...
 
Last edited:

max123

Well-Known Member
Licensed User
Longtime User
Many thanks @LucaMs italian like me.
I will try it, I'm curious to know how do you managed it..... I tried it in many ways but without success. ?
 
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Do you have the jNotifications.fxml file?
jNotification fxml file ? Do you mean xml file ?
I have xml and jar files and even the full inline jNotification class downloaded from the forum.
It is in the example provided with the library as you said..... I see you used it in attached test project.
 
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
So..... I've tried your code Luca,

It works as expected with jNotification inline class.

Tried to remove the class and use the library and it crashes while compile:
B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private fx As JFX

    Private Notif As jNotifications
End Sub

Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)

    Root = Root1
    Root.LoadLayout("MainPage")

    'Initialize the Notifications
    Dim frm As Form = B4XPages.GetNativeParent(Me)

    Notif.Initialize(Me, "Notif", frm)
    Notif.Image = fx.LoadImageSample(File.DirAssets, "pad1_lores.jpg", 80, 40)
    Notif.setOffset(25, 25)
    Notif.Title = "Server is running ..."
    Notif.Message ="blablabla"
    Notif.SpeedMultiplier = 1
    Notif.Duration = 5 'Note that duration can be set to 0 = infinite.
    Notif.BackColor = fx.Colors.Cyan
    Notif.TitleColor = fx.Colors.Black
    Notif.MessageColor = fx.Colors.Black
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
    Notif.Show
End Sub

My library version is 1.00.
I know that this is an old library (2014) but it is very useful for me and I've used it in many projects.

The problem is that the library works with regular Forms in non B4XPages projects but not works in B4XPages. May it is outdated ? Here the error:
jnotifications._initialize (java line: 287)
java.lang.NoSuchMethodError: anywheresoftware.b4j.objects.PaneWrapper$AnchorPaneWrapper.LoadLayout(Lanywheresoftware/b4a/BA;Ljava/lang/String;)V
at b4j.example.jnotifications._initialize(jnotifications.java:287)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:43)
at b4j.example.b4xmainpage.callSub(b4xmainpage.java:94)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:497)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:468)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:307)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:722)
at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:113)
at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:120)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:491)
at b4j.example.main._appstart(main.java:58)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
 
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
Hi Erel, thanks,

@LucaMs and @Erel I've finally found the problem...... :D

And now the example project compile without problems in B4XPages. :D

But my main project do not compile... Mmmm

The problem as I supposed was that I downloaded jNotification in 2014, now I tried to download it and compare .xml and .jar files.
I noticed some differences, xml now show a dependence of json, not true in my old library. Even jar file size is different.

I noticed that my old jNotification files are dated 2014 and new ones are dated 2016.

The thing that confused me is that both are version 1.00 and there was no version change when the second upload was done in 2016, it should have been maybe 1.01. The IDE does not see the version change, it only see version 1.00 written in gray and nothing is displayed in the 'Online' column.

Now I have only one strange problem, I can change the notification title color, even the message color, but I cannot change the background color, so Notif.BackColor line have no effect at all:
B4X:
    'Initialize the Notifications
    Dim frm As Form = B4XPages.GetNativeParent(Me)
    Notif.Initialize(Me, "Notif", frm)
 
    Notif.Image = fx.LoadImageSample(File.DirAssets, "pad1_lores.jpg", 80, 40)
    Notif.setOffset(25, 25)
 
    Notif.Title = "Server is running ..."
    Notif.Message ="blablabla"
    Notif.SpeedMultiplier = 1
    Notif.Duration = 5 'Note that duration can be set to 0 = infinite.
    Notif.BackColor = fx.Colors.Black ' <<<<<< BACKGROUND IS ALWAYS GRAY COLOR AND DO NOT CHANGE
    Notif.TitleColor = fx.Colors.Green ' THIS WORKS
    Notif.MessageColor = fx.Colors.Red ' THIS WORKS

I've tried with inline class but I do not know where is the problem.
TitleColor is an Object, MessageColor is an Object and BackColor is a Paint (from IDE autocomplete).

As for your request I've attached a small example. It compile now but need jNotification.fxml file in file tab.

Is this the normal use with this library ?
Background is working for you ?

Many thanks

This is the compilation error log if I remove jNotification.fxml from file tab, B4XPages request jNotification.bjl
b4xpagesmanager._createpageifneeded (java line: 307)
java.lang.RuntimeException: java.io.FileNotFoundException: jNotifications.bjl
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:522)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:468)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:307)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:722)
at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:113)
at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:120)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:491)
at b4j.example.main._appstart(main.java:58)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.FileNotFoundException: jNotifications.bjl
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:235)
at anywheresoftware.b4j.objects.LayoutBuilder.loadLayout(LayoutBuilder.java:66)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:101)
at b4j.example.jnotifications._initialize(jnotifications.java:288)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:180)
at b4j.example.b4xmainpage.callSub(b4xmainpage.java:921)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:497)
... 23 more
 

Attachments

  • TestNotif.zip
    11.7 KB · Views: 103
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
@LucaMs now I know because you asked me about jNotification.fxml :D Sorry for mistake.

I noticed you have this file on the test project you posted, that's because my main project now always refused to compile.

When I copied jNotification.fxml from your test project to my project files it now compile.

May I have to edit the main jNotification class to create the small layout by code instead of load fxml layout, and recompile it as library ?

Many thanks
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
May I have to edit the main jNotification class to create the small layout by code instead of load fxml layout, and recompile it as library ?
As you said, it is a very old library and uses an fxml file, JavaFX Scene Builder.
To be honest, the first thing I found was the class, I didn't know there was also a library version.
I assume you can compile the class as is, with the jNotification.fxml file. Otherwise yes, you should modify the class but it is better if you create a .bjl (Designer) layout file instead of creating the views in code.
 
Last edited:
Upvote 0

max123

Well-Known Member
Licensed User
Longtime User
As you said, it is a very old library and uses an fxml file, JavaFX Scene Builder.
To be honest, the first thing I found was the class, I didn't know there was also a library version.
I assume you can compile the class as is, with the jNotification.fxml file. Otherwise yes, you should modify the class but it is better if you create a .bjl (Designer) layout file instead of creating the views in code.
But this way have dependency of bjl file.... I'm not sure if it is good.

It is old, but actually seem to be the best option on B4J, another time, thanks to @jmon for his library.

I tried ControlFX ControlUtils, this works a bit better because manage multiple notifications, but with jNotification (that is even inline class) you can customize more if multiple notifications not needed. Or best multiple notifications can be added by using multiple timers and/or Wait For.

Probably in 2014 I downloaded the jNotification class and compiled myself as library.... so now have dependency of layout file.... I'm not sure, because the library zip have inline class but even xml and jar files.
 
Last edited:
Upvote 0
Top