Project: SWT
Bug 130120 cell custom background colour appears in adjacent cells
Reported: 2006-03-02 09:17:46 | Status: resolved fixed

- run the snippet below, which creates a table with four columns and one item - the item's background is set for the second column to green - but the item's background shows as green in the second through fourth columns - removing the EraseItem listener makes the problem go away public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setBounds(10,10,250,200); final Table table = new Table(shell, SWT.FULL_SELECTION); table.setBounds(10,10,220,150); table.setLinesVisible(true); new TableColumn(table, SWT.NONE).setWidth(50); new TableColumn(table, SWT.NONE).setWidth(50); new TableColumn(table, SWT.NONE).setWidth(50); new TableColumn(table, SWT.NONE).setWidth(50); new TableItem(table, SWT.NONE).setBackground(1, display.getSystemColor(SWT.COLOR_BLUE)); table.addListener(SWT.EraseItem, new Listener() { public void handleEvent(Event event) { } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java