Alignment of text and image in a SWT button?

I am using SWT in Java and I am trying to align the image and text that I have inside the SWT button. It looks like it should be a simple call to button.setAlignment (SWT.LEFT), but that doesn't work. A quick Google search leads me to think that this might be a bug in the SWT environment. Can anyone help with this?

+4
source share
1 answer

This is apparently a limitation of SWT (at least on Windows).

Prior to 3.2, installation of both the image and the text on the button was not possible. After reading this report on the error report , some discussion was expressed regarding the alignment and relative positioning of the image in the text. It seems that the final implementation simply forcibly aligned the center and placed the image to the left of the text.

The request to fix this restriction was fixed, but it was closed as WONTFIX for 3.3 .

+3
source

All Articles