How can I set the margin/padding of the text displayed on an SWT Button?

+3 votes
asked Mar 8, 2013 by micha-wiedenmann

How can I set the margin/padding of the text displayed on an SWT Button?

Button b = new Button(parent, SWT.LEFT);
b.setText("Click me");

I got:

+-----------------+
|Click me |
+-----------------+

I want (notice the space to the left):

+-----------------+
| Click me |
+-----------------+

1 Answer

+2 votes
answered Nov 29, 2018 by tonny-madsen

Padding is not supported for Button. The standard solutions are to either use SWT.CENTER or alternatively add a space to the start of the label...

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
...