...
Dim loader As JavaObject
Dim url As JavaObject
Dim myLayout As JavaObject
loader.InitializeNewInstance("javafx.fxml.FXMLLoader",Null)
url = asJO(Me).RunMethod("getURL",Array As String("file:///c:/b4j source/Files/filelist.fxml"))
loader.RunMethod("setLocation",Array(url))
myLayout = loader.RunMethod("load",Array(url))
MainForm.WindowHeight = myLayout.RunMethod("getHeight",Null)
MainForm.WindowWidth = myLayout.RunMethod("getWidth",Null)
MainForm.RootPane.AddNode(myLayout,0,0,-1,-1)
MainForm.Show
End Sub
Sub asJO(o As JavaObject) As JavaObject
Return o
End Sub
#if java
import java.net.URL;
public static URL getURL(String s){
URL myURL = null;
try{
myURL = new URL(s);
} catch (Exception e) {
System.out.println(e);
}
return myURL;
}
#end if