ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
418
418
EMPFEHLEN
-
Hallo,
ich habe eine swt Table. Initial hat sie keine Elemente, jedoch einen "Add"-Button, der jeweils eine neue Zeile zur Tabelle hinzufügt. Bis hierher funktioniert es auch.
Wenn die Tabelle jedoch größer wird, als der ihm zur Verfügung stehende Platz, so "rutscht" mein "Add"-Button leider unten aus dem sichtabren Bereich. Am liebesten wäre mir, wenn die Tabelle nur bis zum Rand wächst und dann einen Scrollbalken erhält., sodass es weiterhin möglich ist neue Zeilen zu erzeugen.
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
// parent Composite final Composite parent = new Composite(compProperties, SWT.NONE); localPropertiesComp.setLayout(new FormLayout()); final FormData formDataLocalPropertiesComp = new FormData(); formDataLocalPropertiesComp.top = new FormAttachment(topComposite, 5); formDataLocalPropertiesComp.left = new FormAttachment(0, 5); formDataLocalPropertiesComp.right = new FormAttachment(100, -5); formDataLocalPropertiesComp.bottom = new FormAttachment(100, -10); localPropertiesComp.setLayoutData(formDataLocalPropertiesComp); final Group group= new Group(parent , SWT.NONE); group.setLayout(new FormLayout()); group.setText("Group"); final FormData formDataBorder2 = new FormData(); formDataBorder2.right = new FormAttachment(100, -5); formDataBorder2.left = new FormAttachment(0, 5); formDataBorder2.top = new FormAttachment(0, 5); group.setLayoutData(formDataBorder2); // local properties table final Table localTable = new Table(group, SWT.BORDER); localTable.setLinesVisible(true); localTable.setHeaderVisible(true); FormData formDataTable2 = new FormData(); formDataTable2.right = new FormAttachment(100, -5); formDataTable2.left = new FormAttachment(0, 5); formDataTable2.top = new FormAttachment(0, 5); localTable.setLayoutData(formDataTable2); // first column -key- TableColumn keyColumn2 = new TableColumn(localTable, SWT.NONE); keyColumn2.setWidth(200); keyColumn2.setText("Key"); // second column -value- TableColumn valueColumn2 = new TableColumn(localTable, SWT.NONE); valueColumn2.setWidth(200); valueColumn2.setText("Value"); // third column -Button delete- TableColumn buttonColumn2 = new TableColumn(localTable, SWT.NONE); buttonColumn2.setWidth(250); buttonColumn2.setText("Delete"); Button addRowButton = new Button(localBorder, SWT.NONE); addRowButton.setText("+"); addRowButton.setToolTipText("irgendwas"); FormData formDataAddRowButton = new FormData(); formDataAddRowButton.left = new FormAttachment(0, 5); formDataAddRowButton.top = new FormAttachment(localTable, 5); addRowButton.setLayoutData(formDataAddRowButton); addRowButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { new TableItem(localTable, SWT.NONE).setText("" + counter); group.pack(); parent .layout(); counter++; } });Geändert von Alvine (26.11.10 um 11:36 Uhr)
Ähnliche Themen
-
Tabelle - über die Zelle hinaus,...
Von JesusFreak777 im Forum PHPAntworten: 7Letzter Beitrag: 20.08.08, 20:50 -
Text über DIV hinaus
Von L99P im Forum PHPAntworten: 3Letzter Beitrag: 09.08.08, 14:06 -
Weiterleitung über Frames hinaus!
Von ahykes im Forum Javascript & AjaxAntworten: 2Letzter Beitrag: 13.03.05, 21:42 -
Weiterleitung über Frames hinaus!
Von ahykes im Forum HTML & XHTMLAntworten: 4Letzter Beitrag: 11.03.05, 15:59 -
Menü wird nicht über Frame hinaus hinaus angezeig
Von Plantus im Forum Javascript & AjaxAntworten: 4Letzter Beitrag: 19.11.04, 11:07





Zitieren
Login





