so27 Active Member Licensed User Longtime User Sep 2, 2020 #1 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: main._appstart (java line: 111) 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) at b4j.example.main._appstart(main.java:111) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91) at anywheresoftware.b4a.BA.raiseEvent(BA.java:78) at b4j.example.main.start(main.java:37) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:834) Click to expand... I'm using OpenJDK 11 + OpenJFX 11. What am I doing wrong?
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: main._appstart (java line: 111) 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) at b4j.example.main._appstart(main.java:111) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91) at anywheresoftware.b4a.BA.raiseEvent(BA.java:78) at b4j.example.main.start(main.java:37) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:834) Click to expand... I'm using OpenJDK 11 + OpenJFX 11. What am I doing wrong?
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2020 #2 Code looks correct. The problem is somewhere else. Upvote 0
Jorge M A Well-Known Member Licensed User Longtime User Sep 3, 2020 #4 @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. Code: B4XFloatTextField1.Text = "Abcde" B4XFloatTextField1.TextField.SetTextAlignment("CENTER", "CENTER") Spoiler: Log 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
@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. Code: B4XFloatTextField1.Text = "Abcde" B4XFloatTextField1.TextField.SetTextAlignment("CENTER", "CENTER") Spoiler: Log 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)
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2020 #5 My mistake. It was never supported by text fields: Upvote 0
so27 Active Member Licensed User Longtime User Sep 4, 2020 #6 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
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")