Project: SWT
Bug 274532 Cannot scroll to bottom of virtual table
Reported: 2009-04-30 11:08:03 | Status: resolved fixed

Build ID: 3.5M6 Run snippet below, then select the scrollbar slider and drag it to the bottom - you cannot see the last 5 items. This problem only happens when the table has a column and the items have images. import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.RowData; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; public class TestTableScroll { static final int COUNT = 170; public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new RowLayout(SWT.VERTICAL)); final Table table = new Table(shell, SWT.VIRTUAL | SWT.SINGLE | SWT.FULL_SELECTION); final Image icon = new Image(display, 16, 16); GC iconGc = new GC(icon); iconGc.setBackground(display.getSystemColor(SWT.COLOR_MAGENTA)); iconGc.fillOval(4, 4, 10, 10); iconGc.dispose(); table.setHeaderVisible(true); TableColumn col1 = new TableColumn(table, SWT.LEFT); col1.setText("Column 1"); col1.setWidth(100); table.addListener(SWT.SetData, new Listener() { public void handleEvent(Event event) { TableItem item = (TableItem) event.item; int index = table.indexOf(item); item.setImage(icon); item.setText("Item " + (index + 1)); } }); table.setLayoutData(new RowData(300, 404)); table.setItemCount(COUNT); shell.layout(); shell.pack(); 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