Table rows disappear when scrolling [message #1059103] |
Thu, 16 May 2013 17:23 |
Emily Gouge Messages: 7 Registered: May 2013 |
Junior Member |
|
|
If I create a SWT table which has:
* no header
* more than 32 rows
* a height larger than 400px
when I scroll (left to right or up and down) the content of the table disappears (all cells are blank) until I mouse over the rows at which point the content is re-drawn for the row.
This happens on Windows 7 (64bit java) - I did not see it on the Mac or Linux box we have for testing.
Below is a snippet that reproduces the problem. Scroll to to the right and the content of the table disappears until you mouse over it.
Has anyone else seen this? Should I report it as a bug?
Thanks,
Emily
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
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 TableTest {
private static int NUMCOLS = 40;
private static int NUMROWS = 100;
/**
* @param args
*/
public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new GridLayout(1, false));
Table mainTable = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL );
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
mainTable.setLayoutData(gd);
mainTable.setHeaderVisible(false);
mainTable.setLinesVisible(true);
for (int i = 0; i < NUMCOLS; i ++){
TableColumn column = new TableColumn(mainTable, SWT.NONE);
column.setWidth(60);
column.setText("COLUMN " + (i+1));
}
for (int i = 0; i < NUMROWS; i++){
TableItem item = new TableItem(mainTable, SWT.NONE);
for (int j = 0; j < NUMCOLS; j++){
item.setText(j, i + "_" + j);
}
}
shell.pack ();
shell.setSize(400,400);
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03425 seconds