B4J Question B4XFloatTextField SetTextAlignment with error

so27

Active Member
Licensed User
Longtime User
Hello everybody,

I use a B4XFloatTextField in my program. With SetTextAlignment I want to center the font.
B4X:
    txtGewicht.TextField.SetTextAlignment("CENTER", "CENTER")

An error occurs when starting the program:

I'm using OpenJDK 11 + OpenJFX 11.



What am I doing wrong?
 

Jorge M A

Well-Known Member
Licensed User
@Erel,
It seems that in some update of XUI Views some kind of bug was introduced...
In the original XUI Views Example, (from here) the same error occurs when setting this property.
B4X:
    B4XFloatTextField1.Text = "Abcde"
    B4XFloatTextField1.TextField.SetTextAlignment("CENTER", "CENTER")
Error occurred on line: 446 (B4XFloatTextField)
java.lang.RuntimeException: Type does not match (class javafx.scene.control.TextField)
at anywheresoftware.b4a.objects.B4XViewWrapper.typeDoesNotMatch(B4XViewWrapper.java:573)
at anywheresoftware.b4a.objects.B4XViewWrapper.SetTextAlignment(B4XViewWrapper.java:448)
 
Upvote 0

so27

Active Member
Licensed User
Longtime User
It works fine with B4A and B4i. Only with B4J it obviously doesn't work.

B4X:
    txtGewicht.TextField.SetTextAlignment("CENTER", "CENTER")
    txtGroesse.TextField.SetTextAlignment("CENTER", "CENTER")



 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…