I have a variety of ToggleButtons that are loaded with an image. The buttons size is determinated by the image size and the button itself is created by JavaCode. A few buttons have icons (the icon is just part of the loaded image) on either the left or right side.
How can I move the text by a certain value to the left or right so I can center the text again but with the offset of the icon? I don't mind passing the width of the icon as parameter, but I cant find anything to move the text for a certain amount.
The button is created from the green image, the right icon is part of it; total width is 300, icon is taking 100; the text should be centered to the leftover 200. For language setting reason the text itself cant be part of the picture.