Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private offsetX As Double
Private offsetY As Double
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
maximizeMainForm
MainForm.Show
offsetX=MainForm.Width/2000/1.5
offsetY=MainForm.Height/2000/1.5
End Sub
Private Sub maximizeMainForm
Dim mf As JavaObject = MainForm
mf.GetFieldJO("stage").RunMethod("setMaximized", Array(True))
End Sub
Sub MainForm_MouseClicked (EventData As MouseEvent)
Wait For (loadControlArray) Complete (result As String)
End Sub
Private Sub loadControlArray As ResumableSub
Dim t0 As Long
t0=DateTime.Now
Dim i As Int
Dim x As Double
Dim y As Double
x=1
y=1
For i=1 To 2000
Dim lbl As Label
lbl.Initialize("lbl")
lbl.Text="X"
lbl.Tag=i
MainForm.RootPane.AddNode(lbl,x,y,10dip,10dip)
x=x+offsetX
y=y+offsetY
Sleep(0)
Next
fx.Msgbox(MainForm, NumberFormat((DateTime.Now-t0)/1000,0,0) & " seconds.","")
Return Null
End Sub