1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
//------------------------------------------------------------------------------
import org.eclipse.swt.SWT;
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.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
//------------------------------------------------------------------------------
public class TEST {
private static Display display;
private static Shell shell;
public static void main(String[] args) {
display = new Display();
shell = new Shell(display, SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.RESIZE);
shell.setText("TEXT ..... BLABLA");
shell.setLayout(new GridLayout());
final Composite composite1 = new Composite(shell, SWT.FILL);
composite1.setLayout(new GridLayout());
composite1.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false, 1, 1));
final Table Title = new Table(composite1, SWT.BORDER);
Title.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 0, 0));
Title.setHeaderVisible(false);
Title.setLinesVisible(false);
final TableColumn[] TitleCol = new TableColumn[2];
TitleCol[0] = new TableColumn(Title, SWT.LEFT);
TitleCol[1] = new TableColumn(Title, SWT.RIGHT);
final TableItem l0Title = new TableItem(Title, SWT.NONE);
l0Title.setText(0, "Blablabla1");
l0Title.setText(1, "Blablablabla2");
TitleCol[0].pack();
TitleCol[1].pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
}
} |
Partager