Question

This must be obvious, but I have searched for ages and can find no mention of it anywhere. I'm creating an SWT TableViewer, and I want to have borders around my cells. How do I do this? No matter what I try, my cells are always borderless and it's difficult to tell where one cell ends and another begins. My code:

TableViewer outputViewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
outputViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
TableViewerColumn col = new TableViewerColumn(outputViewer, SWT.LEFT | SWT.BORDER);
col.getColumn().setWidth(200);
col.getColumn().setText("Output");
col.getColumn().setResizable(true);
col.setLabelProvider(new ColumnLabelProvider());
Était-ce utile?

La solution

outputViewer.getTable().setLinesVisable(true);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top