I have the following table:
What I'm wanting to do is extend the column to the size of the window without displaying the extra lines where there is no column (the cells to the right of the item column). I'm somewhat familiar with most of SWT, but these tables are still confusing me.
I want to be able to select an item by clicking anywhere on the row.
Here is the simple UI code I used to make the above screen cap:
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Table table = new Table (shell, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
table.setLinesVisible (true);
table.setHeaderVisible (false);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
data.heightHint = 200;
table.setLayoutData(data);
TableColumn column = new TableColumn (table, SWT.NONE);
column.setResizable(true);
int count = 15;
for (int i=0; i<count; i++) {
TableItem item = new TableItem (table, SWT.NONE);
item.setText (0, "item " + i);
}
column.pack();
shell.pack();
shell.open();
while(!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}