B4J Question LoadLayout fails

giggetto71

Active Member
Licensed User
Longtime User
Hi I am getting crazy but I am sure it's something really silly...I started getting this error on an app that was working so I tried creating a new almost empty one and I got the same error. here's what I get on a new project.
B4J, New UI project, open internal designer and add a new canvas with just one label and a button, saved as Layout1. Checked on hard disk and the Layout1.bjl is infact under Files folder.
I am pretty sure it's something super basic I am missing..
Her's the code

B4X:
Sub Process_Globals
   
    Private MainForm As Form
   
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.SetFormStyle("UNIFIED")
    MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Show
End Sub

thanks for your help.



Errors I get from the log

Program started.
main._appstart (java line: 51)
java.io.FileNotFoundException: Layout1.fxml
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:206)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:133)
at MQTTClient.example.main._appstart(main.java:51)
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:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at MQTTClient.example.main.start(main.java:36)
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)
at java.lang.Thread.run(Thread.java:745)
 
Top