How to alignment for label text [message #1386138] |
Fri, 13 June 2014 15:02 |
Gary Shi Messages: 20 Registered: July 2013 |
Junior Member |
|
|
One label was added: org.eclipse.swt.widgets.Label
When plan to do alignment for the text on the label to right,or , center, top, bottom, I am unable to do it. Any idea about it. Or if I can do add some left padding (space), top padding, ...
My code:
public void createPartControl(Composite arg0) {
Label lblNewLabel = new Label(arg0, SWT.NONE);
lblNewLabel.setBounds(25, 99, 400, 26);
lblNewLabel.setText("this is test");
lblNewLabel.setBackground(org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_DARK_GRAY));
lblNewLabel.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Tahoma", 6, SWT.TOP));
....
)
How to alignment label text "this is test" to the Right ? In default, it is in left and top alignment when I had big bounds.
Thanks
Appreciate it.Gary
|
|
|
|
Powered by
FUDForum. Page generated in 0.03546 seconds