I wrote this code:
When I launch the app it gives me this error:
Error occurred on line: 306 (B4XPagesManager)
java.lang.IllegalStateException: Cannot set style once stage has been set visible
at javafx.graphics/javafx.stage.Stage.initStyle(Stage.java:484)
at anywheresoftware.b4j.objects.Form.SetFormStyle(Form.java:278)
at b4j.example.postit._b4xpage_appear(postit.java:79)
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:234)
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:109)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:509)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:489)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:563)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
What am I doing wrong?
B4X:
Private Sub B4XPage_Appear
B4XPages.setTitle(Me,"Pippo")
B4XPages.GetNativeParent(Me).WindowHeight=400
B4XPages.GetNativeParent(Me).WindowWidth=400
B4XPages.GetNativeParent(Me).Resizable=False
B4XPages.GetNativeParent(Me).SetFormStyle("UTILITY")
Dim MyColors(3) As Int = Array As Int(xui.Color_Yellow, xui.Color_ARGB(255,169,255,169), xui.Color_ARGB(255,169,255,250))
SQL1.InitializeSQLite(Main.DbDir,Main.DbFile,False)
RS1=SQL1.ExecQuery("SELECT * FROM Pippo WHERE ID = " & Main.iID & "")
Do While RS1.NextRow
Dim iCol As Int=RS1.GetInt("colore")-1
Root.Color=MyColors(iCol)
lblTitolo.As(Label).Text=RS1.GetString("titolo")
lblTesto.As(Label).Text=RS1.GetString("testo")
Loop
End Sub
Error occurred on line: 306 (B4XPagesManager)
java.lang.IllegalStateException: Cannot set style once stage has been set visible
at javafx.graphics/javafx.stage.Stage.initStyle(Stage.java:484)
at anywheresoftware.b4j.objects.Form.SetFormStyle(Form.java:278)
at b4j.example.postit._b4xpage_appear(postit.java:79)
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:234)
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:109)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:509)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:489)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:563)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
What am I doing wrong?