I have been told this is the future and I am trying very hard to use it, I rally am.
But I have been trying to fix this for 4 hours....
Setting Text alignment in the designer does not appear to have any affect.
I have a single line B4XFloatTextField that I would like to right align I have the Alignment set to CENTER_RIGHT in the designer but it still aligns left.
The following line sets RIGHT alignment in B4A:
But that line fails in B4J with the following error:
So I have been unable to align text to the right in B4j
I also have a multiline B4XFloatTextField
It starts with text in the upper left corner exactly as I want - regardless of how I set the Alignment property.
I would PREFER that the text NOT wrap - but it does, regardless of how I set Wrap Property.
In B4A, for some reason, a multiline B4XFloatTextField defaults to the text always starting out LEFT CENTERED, and then the first line of text moves UP as you add new lines.
Again, setting Horizontal Alignment and Vertical Alignment in designer seemed to have absolutely no affect.
I also found myself messing around with the single line / multiline settings there are TWO in the B4A designer one under text properties called 'Single Line', and another under custom properties CALLED 'Multiline' I thought perhaps some combination of these would prevent word wrap but it does not appear to be the case.
I was finally able to get the text to the top left with:
but I am still looking for a way to right align text in B4J.
I haven't gotten to B4i yet.
But I have been trying to fix this for 4 hours....
Setting Text alignment in the designer does not appear to have any affect.
I have a single line B4XFloatTextField that I would like to right align I have the Alignment set to CENTER_RIGHT in the designer but it still aligns left.
The following line sets RIGHT alignment in B4A:
FloatTxt1.TextField.SetTextAlignment("CENTER", "RIGHT")
But that line fails in B4J with the following error:
B4X:
Waiting for debugger to connect...
Program started.
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)
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.shell.Shell.runVoidMethod(Shell.java:676)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
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:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:64)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:58)
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.debug.Debug.CallSub4(Debug.java:115)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:81)
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.keywords.Common.CallSubDebug2(Common.java:477)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:868)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:347)
at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:176)
at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:190)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:126)
at b4j.example.main._appstart(main.java:86)
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.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
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:108)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.start(main.java:38)
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)
I also have a multiline B4XFloatTextField
It starts with text in the upper left corner exactly as I want - regardless of how I set the Alignment property.
I would PREFER that the text NOT wrap - but it does, regardless of how I set Wrap Property.
In B4A, for some reason, a multiline B4XFloatTextField defaults to the text always starting out LEFT CENTERED, and then the first line of text moves UP as you add new lines.
Again, setting Horizontal Alignment and Vertical Alignment in designer seemed to have absolutely no affect.
I also found myself messing around with the single line / multiline settings there are TWO in the B4A designer one under text properties called 'Single Line', and another under custom properties CALLED 'Multiline' I thought perhaps some combination of these would prevent word wrap but it does not appear to be the case.
I was finally able to get the text to the top left with:
B4X:
#If B4A
Note.TextField.SetTextAlignment("TOP", "LEFT")
#End If
I haven't gotten to B4i yet.