Armando Barrera Member Licensed User Longtime User May 19, 2022 #1 Hi everyone, I am trying to set the alignment for some TextFields (mainly, to right for numbers), I've been searching in the forum before i create this question, but could not fix my issue. Unfortunaly i din't catch the solutions. If someone knows how can i fix it, I would be very grateful. If more information is needed, please let me know. Best regards Armando Barrera
Hi everyone, I am trying to set the alignment for some TextFields (mainly, to right for numbers), I've been searching in the forum before i create this question, but could not fix my issue. Unfortunaly i din't catch the solutions. If someone knows how can i fix it, I would be very grateful. If more information is needed, please let me know. Best regards Armando Barrera
T thinktank Member May 19, 2022 #2 Try this Code: Dim lbl As Label lbl.Initialize("") Dim jo As JavaObject = lbl jo.RunMethod("setTextAlignment", Array("RIGHT")) Upvote 0
Try this Code: Dim lbl As Label lbl.Initialize("") Dim jo As JavaObject = lbl jo.RunMethod("setTextAlignment", Array("RIGHT"))
T Tomar New Member May 19, 2022 #3 B4X: MyTextField.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) Should work. T. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 19, 2022 #4 1. Make sure to use latest version of B4J. 2. You can set the alignment of TextField with the designer or programmatically with the same API as Label or B4XView. Upvote 0
1. Make sure to use latest version of B4J. 2. You can set the alignment of TextField with the designer or programmatically with the same API as Label or B4XView.
Armando Barrera Member Licensed User Longtime User May 19, 2022 #5 Tomar said: B4X: MyTextField.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) Should work. T. Click to expand... Hi Tomar, Thanks for your quick response, but I'am afraid that I don't know how to adapt it for my matter, i received the next error message: Main - 914: Variable 'javaobject' no declarada se utiliza antes de que se le haya asignado cualquier valor. And in the line: TextField1.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) the word JavaObject became red. And don´t know what to do next. I appreciate your support, thank you very much Code: Sub Button1_Click Dim lbl As Label lbl.Initialize("") Dim jo As JavaObject = lbl jo.RunMethod("setTextAlignment", Array("RIGHT")) TextField1.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) End Sub Upvote 0
Tomar said: B4X: MyTextField.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) Should work. T. Click to expand... Hi Tomar, Thanks for your quick response, but I'am afraid that I don't know how to adapt it for my matter, i received the next error message: Main - 914: Variable 'javaobject' no declarada se utiliza antes de que se le haya asignado cualquier valor. And in the line: TextField1.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) the word JavaObject became red. And don´t know what to do next. I appreciate your support, thank you very much Code: Sub Button1_Click Dim lbl As Label lbl.Initialize("") Dim jo As JavaObject = lbl jo.RunMethod("setTextAlignment", Array("RIGHT")) TextField1.As(JavaObject).RunMethod("setAlignment", Array("CENTER_RIGHT")) End Sub
Armando Barrera Member Licensed User Longtime User May 19, 2022 #6 Erel said: 1. Make sure to use latest version of B4J. 2. You can set the alignment of TextField with the designer or programmatically with the same API as Label or B4XView. Click to expand... Hi Erel, I do not have the B4J latest version. I haven't updated due to my concern that my program is affected, but i will do it. Appreciate your quick support as well, and let you both know the result. Thank you very much Upvote 0
Erel said: 1. Make sure to use latest version of B4J. 2. You can set the alignment of TextField with the designer or programmatically with the same API as Label or B4XView. Click to expand... Hi Erel, I do not have the B4J latest version. I haven't updated due to my concern that my program is affected, but i will do it. Appreciate your quick support as well, and let you both know the result. Thank you very much
mcqueccu Expert Licensed User Longtime User May 19, 2022 #7 Armando Barrera said: Main - 914: Variable 'javaobject' no declarada se utiliza antes de que se le haya asignado cualquier valor. the word JavaObject became red. Click to expand... Tick JavaObject on the libraries tab Upvote 0
Armando Barrera said: Main - 914: Variable 'javaobject' no declarada se utiliza antes de que se le haya asignado cualquier valor. the word JavaObject became red. Click to expand... Tick JavaObject on the libraries tab
T Tomar New Member May 19, 2022 #8 B4X: MyTextField.Alignment = "CENTER_RIGHT" As Erel wrote, in the newest Version you can set the alignment direct. I did not know this yet. T. Upvote 0
B4X: MyTextField.Alignment = "CENTER_RIGHT" As Erel wrote, in the newest Version you can set the alignment direct. I did not know this yet. T.
Armando Barrera Member Licensed User Longtime User May 19, 2022 #9 Hi mcqueccu, I have it ticked but with version 2.06, may be that´s the problem. As said to Erel, i'll update the B4J with latest version (9.5) in fact have the version 8.50. Thank you very much for your support. Upvote 0
Hi mcqueccu, I have it ticked but with version 2.06, may be that´s the problem. As said to Erel, i'll update the B4J with latest version (9.5) in fact have the version 8.50. Thank you very much for your support.
Armando Barrera Member Licensed User Longtime User May 19, 2022 #10 Another question: Is it recommended to uninstall the older version of B4J or can I just start installing the newer one? Upvote 0
Another question: Is it recommended to uninstall the older version of B4J or can I just start installing the newer one?
Armando Barrera Member Licensed User Longtime User May 19, 2022 #11 Armando Barrera said: Another question: Is it recommended to uninstall the older version of B4J or can I just start installing the newer one? Click to expand... I apologize for my last question, i am on the process of installing the new version and read tha is recomended to unistall first. Thanks Upvote 0
Armando Barrera said: Another question: Is it recommended to uninstall the older version of B4J or can I just start installing the newer one? Click to expand... I apologize for my last question, i am on the process of installing the new version and read tha is recomended to unistall first. Thanks
Armando Barrera Member Licensed User Longtime User May 19, 2022 #12 Hi everyone, I've just installed the new version (9.50), my issue is fixed, now i can set the TextField alignment by using the designer. Thank you all Best regards Armando Barrera González Upvote 0
Hi everyone, I've just installed the new version (9.50), my issue is fixed, now i can set the TextField alignment by using the designer. Thank you all Best regards Armando Barrera González