Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table rows disappear when scrolling
Table rows disappear when scrolling [message #1059103] Thu, 16 May 2013 17:23 Go to next message
Emily Gouge is currently offline Emily GougeFriend
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 ();
	}

}
Re: Table rows disappear when scrolling [message #1059647 is a reply to message #1059103] Tue, 21 May 2013 05:33 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
This definitely looks like a bug(verified),probably due to the various fixes and workarounds for "windows" os in setHeaderVisible(false) method and condition.

Do log a bug at
https://bugs.eclipse.org/bugs/


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Table rows disappear when scrolling [message #1059788 is a reply to message #1059647] Tue, 21 May 2013 15:30 Go to previous message
Emily Gouge is currently offline Emily GougeFriend
Messages: 7
Registered: May 2013
Junior Member
Done - #408602

Thanks for your help.
Previous Topic:Check Button on StyledText
Next Topic:SWT.XXX widget cross-reference
Goto Forum:
  


Current Time: Thu Apr 25 00:39:22 GMT 2024

Powered by FUDForum. Page generated in 0.03425 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top