问题
I'm trying to display text on a button. Instead of displaying it as "Vertical", I'd like to display it as
V e r t i c a l
Any assistance is much appreciated.
回答1:
You have to make your own widget to achieve it in SWT. Here is a complete example that you can try. Hope it helps.
回答2:
SWT buttons do support wrapping (since 3.7).
Button button = new Button(parent, SWT.PUSH | SWT.WRAP);
button.setText("V\ne\nr\nt\ni\nc\na\nl");
But unfortunately the lines will be centered as a whole and not individually, so the result does not look particularly good.
来源:https://stackoverflow.com/questions/8091920/displaying-text-on-a-swt-button-vertically