B4J Question [SOLVED] Create textfield not showing

Nokia

Active Member
Licensed User
Longtime User
Trying to create a textfield that can be added to a AnchorPane.. but nothing shows.. when I do a label it works fine..

am I doing it wrong?

B4X:
Sub CreateTextBox(ID As String) As TextField
        
    Dim t As TextField
    t.Initialize("TXT_Script")
    t.tag = ID
    't.SetSize(280, 29)
    t.PrefWidth = 280
    t.PrefHeight = 29
    
    Return t
    
End Sub
 

Nokia

Active Member
Licensed User
Longtime User
Solved issue by:

B4X:
Sub CreateTextBox(ID As String) As TextField
    
    Dim jo As JavaObject
    jo.InitializeNewInstance("javafx.scene.control.TextField", Null)
        
    Dim t As TextField = jo
    t.Initialize("TXT_Script")
    t.tag = ID
    t.Id = ID
    t.PrefWidth = 280
    t.PrefHeight = 29
    
    Return t
    
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…