import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class Test {
public static void main(String args[]) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Composite comp = new Composite(shell,SWT.NONE);
Label l = new Label( comp, SWT.BORDER );
l.setLocation(new Point(10,10));
l.setSize(new Point(100,20));
l = new Label( comp, SWT.BORDER );
l.setLocation(new Point(110,10));
l.setSize(new Point(100,20));
Composite innerComp = new Composite(comp,SWT.NONE);
innerComp.setLocation(new Point(210,10));
innerComp.setSize(new Point(300,100));
innerComp.setBackground(display.getSystemColor(SWT.COLOR_RED));
innerComp.setLayout(new GridLayout(2,false));
Text t = new Text(innerComp,SWT.BORDER);
t.setLayoutData(new GridData());
t.setText("Hello");
// innerComp.layout();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}