tags:

views:

686

answers:

1

I'm using SWT in Java and I'm trying to left align an image and text that I have inside an SWT Button. It seems like it should be a simple button.setAlignment(SWT.LEFT) call, but that isn't working. A quick Google search leads me to believe this may be a bug in the SWT framework. Does anyone have any help on this?

A: 

This appears to be an SWT limitation (at least in Windows).

Prior to 3.2, setting both an Image and Text on a button was not possible. Reading through that bug report, there was some discussion given to alignment and relative positioning of the image to the text. It appears that the final implementation simply forced a center alignment, and placed the image to the left of the text.

There was an enhancement request to fix this limitation, but it was closed as WONTFIX for 3.3.

James Van Huis
Yeah, this was what I was left with too. Alright, I will go with this. I have a "work-around" which I'll post in a comment to my question.
ARF