I wish to have a label in which I can change the text in code. I have done that a lot in B4A but B4J eludes me. I am using JavaFX sceneBuilder 2.0 and wish the scene to have both changeable and unchanged label text. Please let me know what I am doing wrong or not doing. Sample code follows:
Sub AppStart (Form1 AsForm, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Test1Layout") 'Load the layout file.
MainForm.Show
Dim Test1Lbl As Label 'The layout file has the Test1Lbl label with the text "Label"
Test1Lbl.Text="DEF" 'This does not change the label; "Label" still shows.
Dim Lbl As Label 'This label is not in the layout file (in code only)
Lbl.Initialize("") 'This code shows nothing
Lbl.PrefWidth=100
Lbl.PrefHeight=30
Lbl.Left=50
Lbl.Top=5
Lbl.Text="ABC"
End Sub
Walter Degler
Sub AppStart (Form1 AsForm, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Test1Layout") 'Load the layout file.
MainForm.Show
Dim Test1Lbl As Label 'The layout file has the Test1Lbl label with the text "Label"
Test1Lbl.Text="DEF" 'This does not change the label; "Label" still shows.
Dim Lbl As Label 'This label is not in the layout file (in code only)
Lbl.Initialize("") 'This code shows nothing
Lbl.PrefWidth=100
Lbl.PrefHeight=30
Lbl.Left=50
Lbl.Top=5
Lbl.Text="ABC"
End Sub
Walter Degler