Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private WebView1 As WebView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
Dim jo As JavaObject = WebView1
Dim event As Object = jo.CreateEventFromUI("javafx.event.EventHandler", "Alert", Null)
jo.RunMethodJO("getEngine", Null).RunMethod("setOnAlert", Array(event))
jo.RunMethodJO("getEngine", Null).RunMethod("executeScript", Array($"alert("asdasd");"$))
End Sub
Sub Alert_Event (MethodName As String, Args() As Object) As Object
If MethodName = "handle" Then
Log(Args(0))
End If
Return Null
End Sub