Hallo schon wieder ich ...
Also und zwar hab ich zwei Tabellen die gleichzeitig gescrolled werden sollen.
Ähnlich wie in diesem Thread...
Nur eben mit SWT... und ich komm einfach nicht weiter...
Ich hab mal ein KSKB gebaut:
Über hilfe wär ich dankbar
Also und zwar hab ich zwei Tabellen die gleichzeitig gescrolled werden sollen.
Ähnlich wie in diesem Thread...
Nur eben mit SWT... und ich komm einfach nicht weiter...
Ich hab mal ein KSKB gebaut:
Java:
public class TestGUI
{
private Shell shell;
/**
* Runs the application
*/
public void run()
{
Display display = new Display();
shell = new Shell(display);
shell.setSize(250, 250);
shell.setLayout(new GridLayout(1, false));
shell.setText("Test");
Table head = createTable();
fillTable(head);
fillTable(head);
Table table = createTable();
for (int i = 0; i < 20; i++) {
fillTable(table);
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private Table createTable()
{
Table t = new Table(shell, SWT.BORDER);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
data.minimumHeight = 30;
t.setLayoutData(data);
for (int i = 0; i < 15; i++) {
TableColumn tc1 = new TableColumn(t, SWT.CENTER);
tc1.setWidth(70);
}
t.setHeaderVisible(false);
t.setLinesVisible(true);
return t;
}
private void fillTable(Table table)
{
String[] str = new String[15];
for (int i = 0; i < 15; i++) {
str[i] = "" + (i + 1);
}
TableItem itemHead;
itemHead = new TableItem(table, SWT.NONE);
itemHead.setText(str);
}
public static void main(String[] args)
{
new TestGUI().run();
}
}
Über hilfe wär ich dankbar