Sub Class_Globals
...
Dim pw As JavaObject
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
pw.InitializeNewInstance("javafx.scene.control.PasswordField",Null)
Root.AddView(pw,50,200,400,20)
Me.as(JavaObject).RunMethod("addHandler",Array(pw))
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
#if java
import javafx.scene.control.PasswordField;
public static void addHandler(PasswordField pw){
pw.textProperty().addListener((obs, oldText, newText) -> {
System.out.println("Password changed to: " + newText);
});
}
#End If