import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;

public class RowLayoutDemo {

	public static Display myDisplay;
	public static boolean internalCall = false;

	public static void main(String[] args) {
		internalCall = true;
		myDisplay = new Display();
		RowLayoutDemo rld = new RowLayoutDemo();
		rld.runDemo(myDisplay);
	}
	
	public void runDemo(Display display) {
		myDisplay = display;
		Shell shell = new Shell(display);
		shell.setSize(300,100);
		shell.setText("Row Layout Demo");
		RowLayout rowLayout = new RowLayout();
		rowLayout.pack = false;
		shell.setLayout(rowLayout);
		
		Button b1 = new Button(shell, SWT.PUSH);
		b1.setText("Address");
		Button b2 = new Button(shell, SWT.PUSH);
		b2.setText("Phone Numbers");
		Button b3 = new Button(shell, SWT.PUSH);
		b3.setText("Credit Cards");
		Button b4 = new Button(shell, SWT.PUSH);
		b4.setText("Organizations");
		Button b5 = new Button(shell, SWT.PUSH);
		b5.setText("Cancel");
		Button b6 = new Button(shell, SWT.PUSH);
		b6.setText("OK");
		
		shell.open();
		
		while(!shell.isDisposed()){
		if(!display.readAndDispatch())
			display.sleep();
		}
		if (internalCall) display.dispose();
	}
}
