Trying this, but did not work (with jSystemTray lib):
B4X:
Private icon1 As SystemTray
Dim jo As JavaObject = icon1
jo.RunMethod("displayMessage",Array As Object("Success", "Changes pushed successfully", "INFO"))
Private icon1 as SystemTray
icon1.Initialize
Dim jo As JavaObject = icon1
jo.RunMethod("displayMessage",Array As Object("Phoenix Creator", "Starting...", "NONE"))
it causes this message in the log:
B4X:
main$ResumableSub_AppStart.resume (java line: 184)
java.lang.RuntimeException: Method: displayMessage not found in: anywheresoftware.b4j.objects.SystemTrayWrapper
at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:363)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120)
at phoenix.creator.main$ResumableSub_AppStart.resume(main.java:184)
at phoenix.creator.main._appstart(main.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at phoenix.creator.main.start(main.java:37)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
The b4j SystemTray Object does not have a method displayMessage.
Maybe SystemTray is just a small/basic Wrapper around java.awt.SystemTray. It has Methods for an Icon...
You maybe need to get the property "st" from the SystemTray Object first. This is the awt.SystemTray. Maybe using replector.
The older i get the more i think i am forgetting more things that i ever have learned - but coding in some different (coding) languages sometimes i lost the "thread"