import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;

public class FillLayoutDemo {

	public static Display myDisplay;
	public static boolean internalCall = false;

	public static void main(String[] args) {
		internalCall = true;
		myDisplay = new Display();
		FillLayoutDemo fld = new FillLayoutDemo();
		fld.runDemo(myDisplay);
	}
	
	public void runDemo(Display display) {
		myDisplay = display;
		Shell shell = new Shell(display);
		shell.setSize(200,150);
		shell.setLayout(new FillLayout(SWT.VERTICAL));
		shell.setText("Fill Layout Demo");
		//shell.setLayout(new RowLayout(SWT.VERTICAL));
		
		Label label0 = new Label(shell, SWT.NONE);
		label0.setText("Instructions:");
		Label label1 = new Label(shell, SWT.NONE);
		label1.setText("1. Fill in your name");
		Label label2 = new Label(shell, SWT.NONE);
		label2.setText("2. Fill in your age");
		Label label3 = new Label(shell, SWT.NONE);
		label3.setText("3. Fill in your gender");
		Label label4 = new Label(shell, SWT.NONE);
		label4.setText("4. Check the box for employment");
		Label label5 = new Label(shell, SWT.NONE);
		label5.setText("5. Click on OK");
		
		shell.open();
		
		while(!shell.isDisposed()){
		if(!display.readAndDispatch())
			display.sleep();
		}
		if (internalCall) display.dispose();
		
	}
}
