Bug 28503 - Can not indent text in a Label
Can not indent text in a Label
Status: RESOLVED INVALID
Product: Platform
Classification: Eclipse
Component: SWT
2.0.2
PC Windows 2000
: P3 normal (vote)
: ---
Assigned To: Platform-SWT-Inbox CLA Friend
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2002-12-17 09:31 EST by Dmitry Tumanov CLA Friend
Modified: 2002-12-18 10:18 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Tumanov CLA Friend 2002-12-17 09:31:13 EST
There's no way to indent text in a label. This is necessary for displaying 
labels in the table.
Comment 1 Grant Gayed CLA Friend 2002-12-18 10:18:05 EST
You can do either of the following:
- place the Label widget where it should really go, so no indenting required
- prefix your string with spaces or "\t".  eg.-

public class Main {
	public static void main(String[] args) {
		Display d = Display.getDefault();
		Shell shell = new Shell(d);
		shell.setSize(800, 200);
		Label label = new Label(shell,SWT.BORDER);
		label.setBounds(10,10,100,20);
		label.setText("\ttext");
		shell.open();
		while (!shell.isDisposed()) {
			if (!d.readAndDispatch()) {
				d.sleep();
			}
		};
	}
}