Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Label1 As Label
Private ctxMenu As ContextMenu
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
ctxMenu.Initialize("")
Dim MT() As String = Array As String("MI1","MI2","MI3")
For i = 0 To MT.Length - 1
Dim Mi As MenuItem
Mi.Initialize(MT(i),"ctxm")
ctxMenu.MenuItems.Add(Mi)
Next
End Sub
Private Sub Label1_MouseClicked (E As MouseEvent)
Dim jo As JavaObject = ctxMenu
Dim ScreenX As Double = E.As(JavaObject).RunMethod("getScreenX", Null)
Dim ScreenY As Double = E.As(JavaObject).RunMethod("getScreenY", Null)
jo.RunMethod("show",Array(Label1,ScreenX,ScreenY))
End Sub
Sub ctxm_Action
Dim Mi As MenuItem = Sender
Log(Mi.Text)
End Sub