import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.*;

public class LayoutsDemo {

	public static Display display;

	public static void main(String[] args) {
		LayoutsDemo bwd = new LayoutsDemo();
		bwd.runDemo();
	}

	public void runDemo() {
		display = new Display();
		Shell shell = new Shell(display);
		shell.setSize(400,400);
		shell.setText("Layouts Demo");

		Label label1 = new Label(shell, SWT.NULL);
		label1.setText("Layouts Demo");
		label1.setLocation(120,10);
		label1.setSize(100,30);

		Button button1 = new Button(shell,SWT.PUSH);
		button1.setText("Fill Layout Demo");
		button1.setLocation(10,50);
		button1.setSize(140,30);
		button1.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				FillLayoutDemo fld = new FillLayoutDemo();
				fld.runDemo(display);
			}
		});


		Button button2 = new Button(shell,SWT.PUSH);
		button2.setText("Form Layout Demo");
		button2.setLocation(170,50);
		button2.setSize(140,30);
		button2.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				FormLayoutDemo fold = new FormLayoutDemo();
				fold.runDemo(display);
			}
		});

		Button button3 = new Button(shell,SWT.PUSH);
		button3.setText("Grid Layout Demo");
		button3.setLocation(10,100);
		button3.setSize(140,30);
		button3.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				GridLayoutDemo gld = new GridLayoutDemo();
				gld.runDemo(display);
			}
		});

		Button button4 = new Button(shell,SWT.PUSH);
		button4.setText("Row Layout Demo");
		button4.setLocation(170,100);
		button4.setSize(140,30);
		button4.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				RowLayoutDemo rld = new RowLayoutDemo();
				rld.runDemo(display);
			}
		});


		shell.open();

		while(!shell.isDisposed()){
		if(!display.readAndDispatch())
			display.sleep();
		}
		display.dispose();
	}
}

