B4J Question Create a password field by code


B4X founder
Staff member
Licensed User
Longtime User
Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   Dim tf As TextField = CreatePasswordField
   MainForm.RootPane.AddNode(tf, 0, 0, 100, 50)
End Sub

Sub CreatePasswordField As TextField
   Dim jo As JavaObject
   jo.InitializeNewInstance("javafx.scene.control.PasswordField", Null)
   Return jo
End Sub
Upvote 0
I've successfully added a textfield with password property.
But how could I add an event to this node e.g. Action / Mouseclicked etc.
(Because the textfield is not initialized as in the usual simple way so I could not assign an eventname to it)
Upvote 0