tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
0
ZUGRIFFE
418
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Alvine Alvine ist offline Rookie
    Registriert seit
    Aug 2007
    Beiträge
    8
    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++;
                }
            });
    Miniaturansicht angehängter Grafiken Miniaturansicht angehängter Grafiken swt Table wächst über das Composite hinaus-screen.jpg  
    Geändert von Alvine (26.11.10 um 11:36 Uhr)
     

Ähnliche Themen

  1. Tabelle - über die Zelle hinaus,...
    Von JesusFreak777 im Forum PHP
    Antworten: 7
    Letzter Beitrag: 20.08.08, 20:50
  2. Text über DIV hinaus
    Von L99P im Forum PHP
    Antworten: 3
    Letzter Beitrag: 09.08.08, 14:06
  3. Weiterleitung über Frames hinaus!
    Von ahykes im Forum Javascript & Ajax
    Antworten: 2
    Letzter Beitrag: 13.03.05, 21:42
  4. Weiterleitung über Frames hinaus!
    Von ahykes im Forum HTML & XHTML
    Antworten: 4
    Letzter Beitrag: 11.03.05, 15:59
  5. Menü wird nicht über Frame hinaus hinaus angezeig
    Von Plantus im Forum Javascript & Ajax
    Antworten: 4
    Letzter Beitrag: 19.11.04, 11:07