import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;

public class FirstComposite extends Composite {

	public FirstComposite(Composite parent, int style) {
		super(parent, style);

		GridLayout layout = new GridLayout();
		layout.numColumns = 3;
		setLayout(layout);

		Label label1 = new Label(this, SWT.NULL);
		label1.setText("名前");
		Text textName = new Text(this, SWT.BORDER);
		GridData gd1 = new GridData();
		gd1.horizontalSpan = 2;
		gd1.widthHint = 150;
		textName.setLayoutData(gd1);

		Label label2 = new Label(this, SWT.NULL);
		label2.setText("住所");
		Text textAddress = new Text(this, SWT.BORDER);
		GridData gd2 = new GridData();
		gd2.horizontalSpan = 2;
		gd2.widthHint = 300;
		textAddress.setLayoutData(gd2);
		

		Button buttonAdd = new Button(this, SWT.NULL);
		buttonAdd.setText("↓追加(Insert)");
		Button buttonUpd = new Button(this, SWT.NULL);
		buttonUpd.setText("↓更新(Enter)");
		Button buttonDel = new Button(this, SWT.NULL);
		buttonDel.setText("↑削除(Del)");

		Table table = new Table(this, SWT.NULL);
		GridData gd3 = new GridData();
		gd3.horizontalSpan = 3;
		gd3.widthHint = 400;
		gd3.heightHint = 200;
		table.setLayoutData(gd3);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		table.setSize(300,200);
		TableColumn col1 = new TableColumn(table, SWT.NULL);
		col1.setText("名前");
		col1.setWidth(100);
		TableColumn col2 = new TableColumn(table, SWT.NULL);
		col2.setText("住所");
		col2.setWidth(300);
		
		setSize(430,300);
	}	
}


