B4J Question JavaObject & Priority?

LWGShane

Well-Known Member
Licensed User
Longtime User
How do I use the "javafx.scene.layout.Priority" with JavaObject?

For example, to run the "setHgrow" method with a Priority of "ALWAYS".
 

Daestrum

Expert
Licensed User
Longtime User
Small example
B4X:
...
 Dim hbox As JavaObject
 Dim priority As JavaObject
 Dim b As Button
 b.Initialize("button1")
 b.Text = "Press Me"
 b.PrefWidth = 200
 hbox.InitializeNewInstance("javafx.scene.layout.HBox",Null)
 priority.InitializeStatic("javafx.scene.layout.Priority")
 hbox.RunMethod("setHgrow",Array(b,priority.GetField("ALWAYS")))
 hbox.RunMethodJO("getChildren",Null).RunMethod("add",Array(b))
...
 
Upvote 0
Top