-
Notifications
You must be signed in to change notification settings - Fork 32
DynamicTableColumns
lcaron edited this page Jul 5, 2015
·
1 revision
This is an enhanced version of Table, which support percentage width and pixel width. Thus you columns fit perfectly !
This table works exactly like Table. The only difference is visible in the setWidth method :
tblcId = new DynamicTableColumn(tblDyn, SWT.NONE);
tblcId.setText("Id");
tblcId.setWidth("25px");
tblcFirstName = new DynamicTableColumn(tblDyn, SWT.NONE);
tblcFirstName.setText("First Name");
tblcFirstName.setWidth("50%", "100px");
tblcLastName = new DynamicTableColumn(tblDyn, SWT.NONE);
tblcLastName.setText("Last Name");
tblcLastName.setWidth("50%", "100px");
tblcAge = new DynamicTableColumn(tblDyn, SWT.NONE);
tblcAge.setText("Age");
tblcAge.setWidth("60px");
An example called DynamicTableColumnsSnippet is available in the directory src/test/java/org/mihalis/opal/dynamictablecolumns.
This example is also available here : https://github.com/lcaron/opal/blob/master/src/test/java/org/mihalis/opal/dynamictablecolumns/DynamicTableColumnsSnippet.java