Agreed, but the (sub)issue is that the B4J equivalent of B4A EditText does not show a Password property:
(although it does have a checkbox for it in Designer)
I looked at the source code of B4XFloatTextfield. It is all done explicitly. Here is an excerpt.
B4X:
Private Sub CreateRevealButton
lblClear = CreateButton(Chr(0xE8F4))
lblClear.Tag = "reveal"
End Sub
Private Sub SwitchFromPasswordToRegular (ToRegular As Boolean)
Dim text As String = mTextField.Text
Dim textcolor As Int = mTextField.TextColor
Dim Font1 As B4XFont = mTextField.Font
Dim oldfield As B4XView = mTextField
CreateTextFieldAll(Not(ToRegular), Font1, textcolor)
mTextField.Text = text
If lblClear.IsInitialized Then
If ToRegular = False Then
lblClear.Text = Chr(0xE8F4)
lblClear.Tag = "reveal"
Else
lblClear.Tag = "hide"
lblClear.Text = Chr(0xE8F5)
End If
lblClear.BringToFront
End If
'....'
End Sub
Dim tf As TextField
If Password Then tf.InitializePassword("tf") Else tf.Initialize("tf")
Try this in B4j. The password will be revealed in 5 seconds.
B4X:
Dim tf As TextField
tf.InitializePassword("event")
tf.Text = "abcdef"
Root.AddView(tf, 100, 400, 300, 50)
Sleep(5000)
Dim text As String = tf.text
tf.RemoveNodeFromParent
Dim tf As TextField
tf.Initialize("event")
tf.Text = text
Root.AddView(tf, 100, 400, 300, 50)