I would like to have a window always on top of all the other desktop windows. "System top most". Is it possible with B4J? I have the feeling that it's the stage/toFront() from this page, but I don't know how to implement it in B4J.
setAlwaysOnTop(Form, True)
Sub setAlwaysOnTop(frm As Object, Value As Boolean)
Dim frmJO As JavaObject = frm
Dim stage As JavaObject = frmJO.GetField("stage")
stage.RunMethod("setAlwaysOnTop", Array(Value))
End Sub
setAlwaysOnTop(Form, True)
Sub setAlwaysOnTop(frm As Object, Value As Boolean)
Dim frmJO As JavaObject = frm
Dim stage As JavaObject = frmJO.GetField("stage")
stage.RunMethod("setAlwaysOnTop", Array(Value))
End Sub
Error function!!! I need to have a window always on top, I used the following code, but by mistake
B4X:
setAlwaysOnTop(FormEdit, True)
B4X:
Sub setAlwaysOnTop(frm As Object, Value As Boolean)
Dim frmJO As JavaObject = frm
Dim stage As JavaObject = frmJO.GetField("stage")
stage.RunMethod("setAlwaysOnTop", Array(Value))
End Sub
B4X:
Program started.
Error occurred on line: 124 (cssmodule).
java.lang.RuntimeException: Method: setAlwaysOnTop not found in: javafx.stage.Stage
at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:367)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:606)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:227)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
at anywheresoftware.b4a.BA$2.run(BA.java:165)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:744)