Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private Canvas1 As B4XView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Dim txt As JavaObject
txt.InitializeNewInstance("javafx.scene.text.Text",Array("hello"))
MainForm.RootPane.AddNode(txt,20,20,100,20)
(Canvas1).As(JavaObject).RunMethodjo("getGraphicsContext2D",Null).RunMethod("setImageSmoothing",Array(False))
End Sub
Sub Button1_Click
Canvas1.As(Canvas).DrawText("Hello",20,20,xui.CreateFont(fx.DefaultFont(20),20),fx.Colors.Blue,"LEFT")
End Sub