Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] TABLE REFRESH PROBLEM

The problem is when i scroll the table.
I have a refresh problem so i do not see the item in the table when i
scroll.

I use linux ubuntu (The same problem on slackware) with latest nvidia
kernel modules and the latest swt api.

thank you,
Michele

Here the complete snippet:

package guitests;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.*;

import pdf.*;


public class ttt {
	private static Table table;

	private static Font font2;

	public ttt() {
		super();
	}

	public static void main(String[] args) throws Exception {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());

		font2 = new Font(display, "Verdana", 10, SWT.NONE);

		table = new Table(shell, SWT.BORDER|SWT.V_SCROLL);
		table.setLayoutData(new GridData(GridData.FILL_BOTH));
		table.setFont(font2);
		table.setLinesVisible(true);
		table.setHeaderVisible(true);

		table.setBackgroundMode(SWT.INHERIT_DEFAULT);
		table.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
		TableColumn colonnacodice = new TableColumn(table, SWT.NONE);
		colonnacodice.setText("CODICE");
		TableColumn colonnadescrizione = new TableColumn(table, SWT.NONE);
		colonnadescrizione.setText("DESCRIZIONE");
		TableColumn ordina = new TableColumn(table, SWT.NONE);
		ordina.setText("ORDINA");
		for (int i = 0; i < 50; i++) {
			TableItem item = new TableItem(table, SWT.WRAP);
			item.setText(0, "23423423424");
			item.setText(1, "Item desciption "+i);

			TableEditor edito = new TableEditor(table);
			edito.horizontalAlignment = SWT.CENTER;
			edito.verticalAlignment = SWT.CENTER;
			edito.minimumWidth = 60;

			Button button = new Button(table, SWT.NONE);
			button.setText("Ordina");
			button.pack();
			button.setData(i);

			edito.setEditor(button, item, 0);
			edito.setColumn(2);
			edito.setItem(item);
		}
		colonnacodice.pack();
		colonnadescrizione.pack();
		ordina.pack();
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();

	}

}

 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Un look da modella in pochi secondi, consigliato da Hunter Tylo
* 
* 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7111&d=19-10


Back to the top