Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
nativeMe = Me
Dim aa(7) As Object
Dim x As Int = 0
Dim y As Int = 3
aa(0) = CreatePoint(x, y)
Dim x As Int = 2
Dim y As Int = 3
aa(1) = CreatePoint(x, y)
Dim x As Int = 1
Dim y As Int = 1
aa(2) = CreatePoint(x, y)
Dim x As Int = 2
Dim y As Int = 1
aa(3) = CreatePoint(x, y)
Dim x As Int = 3
Dim y As Int = 0
aa(4) = CreatePoint(x, y)
Dim x As Int = 0
Dim y As Int = 0
aa(5) = CreatePoint(x, y)
Dim x As Int = 3
Dim y As Int = 3
aa(6) = CreatePoint(x, y)
Dim leng As Int = aa.Length
Log("***************")
For i = 0 To leng - 1
Log(aa(i))
Next
Dim arr As JavaObject
arr.InitializeArray("b4j.example.main.Point", aa)
nativeMe.RunMethod("checkPoints", Array(arr))
End Sub
Private Sub CreatePoint(x As Int, y As Int) As Object
Dim p As JavaObject
p.InitializeNewInstance("b4j.example.main.Point", Array(x, y))
Return p
End Sub
#If Java
public static class Point {
public int x, y;
public Point(int x, int y){
this.x=x;
this.y=y;
BA.Log("" + this);
}
}
public static void checkPoints (Point points[]) {
BA.Log("" + points);
}
#End If