문제

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());
도움이 되었습니까?

해결책

outputViewer.getTable().setLinesVisable(true);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top