B4J Question How to compute the width of a label, based on the length of the text, and the font

B4JExplorer

Active Member
Licensed User
Longtime User
Hi,

If at Runtime you want to set the length of a label, to cover exactly the text content, how do you calculate the width of that label?

E.g., if your label text is "B4J label", which consists of 9 characters, and you're using Times New Roman 14, and you want no padding on that label, how do we compute the length?
 
Top