I created a table with SWT and I included SWT widgets such as Label, Text in the table cells using TableEditor. But now my problem is, the outlines of the table cells are not visible now. I want to make visible all the borders of columns and rows. How to do it? Setting table.setLinesVisible(true)
is not a success!
Table table = new Table(detailArea, SWT.BORDER | SWT.MULTI);
table.setLinesVisible(true);
for (int i = 0; i < 4; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setWidth(100);
}
TableItem x1= new TableItem(table, SWT.NONE);
TableEditor editorw = new TableEditor(table);
Label lblName =new Label(table, SWT.NONE);
lblName.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblName.setText("Language");
editorw.grabHorizontal = true;
editorw.setEditor(lblName, x1, 0);
editorw = new TableEditor(table);
Text txtLang = new Text(table, SWT.BORDER);
editorw.grabHorizontal = true;
editorw.setEditor(txtLang, x1, 1);
editorw = new TableEditor(table);
Label lblReference = new Label(table,
SWT.NONE);
lblReference.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblReference.setText("Value");
editorw.grabHorizontal = true;
editorw.setEditor(lblReference, x1, 2);
editorw = new TableEditor(table);
Text txtValue= new Text(table, SWT.BORDER);
editorw.grabHorizontal = true;
editorw.setEditor(txtValue, x1, 3);
/////table row 2
TableItem x2= new TableItem(table, SWT.NONE);
editorw = new TableEditor(table);
Label lblName2 =new Label(table, SWT.NONE);
lblName2.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblName2.setText("Language");
editorw.grabHorizontal = true;
editorw.setEditor(lblName2, x2, 0);
editorw = new TableEditor(table);
Text txtLang2 = new Text(table, SWT.BORDER);
editorw.grabHorizontal = true;
editorw.setEditor(txtLang2, x2, 1);
editorw = new TableEditor(table);
Label lblReference2 = new Label(table,
SWT.NONE);
lblReference2.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblReference2.setText("Value");
editorw.grabHorizontal = true;
editorw.setEditor(lblReference2, x2, 2);
editorw = new TableEditor(table);
Text txtValue2= new Text(table, SWT.BORDER);
editorw.grabHorizontal = true;
editorw.setEditor(txtValue2, x2, 3);
table.setLinesVisible(true);
Following is the current output: