B4J Question password field text field is not raising the action event

le_toubib

Active Member
Licensed User
Longtime User
hi all
i m using a password field created through this code from rwblinn :
B4X:
Sub CreatePasswordField As TextField
   Dim jo As JavaObject
   jo.InitializeNewInstance("javafx.scene.control.PasswordField", Null)
   Return jo
End Sub

but it s not raising the action event ? what am i missing ???
 

Daestrum

Expert
Licensed User
Longtime User
To create a password field you only need

B4X:
Dim tf As TextField

...
' initialise like any other control for the sub name to handle it
 tf.InitializePassword("pword")  
...

Sub pword_Action
' do something with the password field
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can also add a TextField with the designer and check the password option:

SS-2016-07-15_07.45.38.png
 
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
To create a password field you only need

B4X:
Dim tf As TextField

...
' initialise like any other control for the sub name to handle it
tf.InitializePassword("pword") 
...

Sub pword_Action
' do something with the password field
End Sub
Thanks for reply ..
It worked like charms but only when I added the control programmatically and not through the builder
 
Upvote 0
Top