Hallo Leute,
ich habe ein Problem mit folgender GUI:
Es sollen 20 Zeilen mit je einem Textfeld und einem Button in einem Tab angezeigt werden.
Soweit funktioniert das auch. Jedoch werden die Elemente auf maximal die Hälfte der Breite des Fensters gestaucht. Ein setzen der Größe mit setSize(int, int) ist wirkungslos.
Anbei der Code… und im Voraus schonmal vielen Dank für Eure Mühe!
Gruß
Matthias
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
public class JMain {
public static void main(String[] args) {
Display display;
Shell shell;
GridLayout gridLayout1, gridLayout2;
Button[] button = new Button[20];
Text[] text = new Text[20];
display = new Display();
shell = new Shell(display);
shell.setText(„Test“);
gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
gridLayout2 = new GridLayout();
gridLayout2.numColumns = 2;
shell.setLayout(new FillLayout());
Composite compositeMain = new Composite(shell, SWT.NONE);
compositeMain.setLayout(new FillLayout());
TabFolder tabFolder = new TabFolder(compositeMain, SWT.NONE);
tabFolder.setLayout(new FillLayout());
TabItem tabItem1 = new TabItem(tabFolder, SWT.NONE);
tabItem1.setText(„Tab 1“);
Composite composite1 = new Composite(tabFolder, SWT.NONE);
composite1.setLayout(gridLayout1);
tabItem1.setControl(composite1);
TabItem tabItem2 = new TabItem(tabFolder, SWT.NONE);
tabItem2.setText(„Tab 2“);
Composite composite2 = new Composite(tabFolder, SWT.NONE);
composite2.setLayout(gridLayout2);
tabItem2.setControl(composite2);
for (int i = 0; i