# Fehler bei Grouplayout



## NePec (7. Jun 2010)

Hallo liebe Java Community!

vor weg, ihr seit einfach spitze! Ich liebe dieses Forum 

Ich bekomme seit kurzem folgende Fehlermedlung:

Exception in thread "main" java.lang.NullPointerException
        at javax.swing.GroupLayout$ComponentSpring.getBaseline(GroupLayout.java:2997)
        :
        :
darunter kommen noch einige andere Fehler die alle mit dem Grouplayout zu tun haben!

Wenn ich nun auf die Funktion hinspringe, erscheint dieser Code:

```
int getBaseline() {
            if (baseline == -1) {
                Spring horizontalSpring = getComponentInfo(component).horizontalSpring;
      ***       int width = horizontalSpring.getPreferredSize(HORIZONTAL);
                int height = getPreferredSize(VERTICAL);
                if (width > 0 && height > 0) {
                    baseline = component.getBaseline(width, height);
                }
            }
            return baseline;
        }
```

Der Fehler wird in der Zeile mit "int width = horizontalSpring.getPreferredSize(HORIZONTAL);" agezeigt! (dort wo die 3 Sterne sind)

Hier is ein Teil des Codes in dem das Grouplayout vorkommt und die deklaration der Liste, die ich in dem Ausschnitt verwende! Ich poste nicht das komplette Layout, das es wahrscheinlich zu groß und zu unübersichtlich wäre!

```
public List<javax.swing.JTextField> list_tf_Raum1_PosNr1= new Vector<javax.swing.JTextField>(1,1);

list_tf_Raum1_PosNr1.add(tf_prototyp);

.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
```

Der komplette Code hat bereits funktioniert, nur habe ich zu dem Zeitpunkt keinen Vektoren, sondern Variablen verwendet! Liegt es an den Vekotren das der Code nicht mehr funktioniert?

Danke im Voraus
NePec


----------



## André Uhres (8. Jun 2010)

Könnte es sein daß der Wert von "size_all" ungültig ist? Beachte, dass der höchste Wert gleich der Anzahl der Elemente minus eins ist.


----------



## NePec (8. Jun 2010)

Ich werd das mal mit dem Debugger durchschauen, aber normalerweise sollte es passen!
Am Anfang steht der Wert von size_all auf 0, dann wird das ganze Programm durchlaufen und erst am Schluss wird size_all erhöht. 
1 Element in der Liste - size_all=0
2 Elemente in der Liste - size_all=1


----------



## Ebenius (9. Jun 2010)

Poste mal bitte den kompletten StackTrace in einem 
	
	
	
	





```
-Block.

Ebenius
```


----------



## NePec (10. Jun 2010)

Hm, kann mir bitte jemand sagen woher man diesen Stack Trace bekommt?
Hab das noch nie gemacht


----------



## hansmueller (11. Jun 2010)

Hallo,

einfach die komplette Fehlermeldung (in einem 
	
	
	
	





```
-Block) posten.

Aber ich glaube es liegt an dem List-Element.
Ich bezweifle, das der Grouplayoutmanager eine Liste abarbeitet und die Elemente einzeln zum Layout hinzufügt. Das wirst du meines Erachtens schon selber machen müssen.

MfG
hansmueller
```


----------



## NePec (11. Jun 2010)

Das dürfte dann der Stack Trace sein:


```
Exception in thread "main" java.lang.NullPointerException
	at javax.swing.GroupLayout$ComponentSpring.getBaseline(Unknown Source)
	at javax.swing.GroupLayout$BaselineGroup.calculateBaselineAndResizeBehavior(Unknown Source)
	at javax.swing.GroupLayout$BaselineGroup.calculateSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Group.getSpringSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculateSize(Unknown Source)
	at javax.swing.GroupLayout$Group.calculatePreferredSize(Unknown Source)
	at javax.swing.GroupLayout$Spring.getPreferredSize(Unknown Source)
	at javax.swing.GroupLayout.calculateAutopadding(Unknown Source)
	at javax.swing.GroupLayout.prepare(Unknown Source)
	at javax.swing.GroupLayout.preferredLayoutSize(Unknown Source)
	at java.awt.Container.preferredSize(Unknown Source)
	at java.awt.Container.getPreferredSize(Unknown Source)
	at javax.swing.JComponent.getPreferredSize(Unknown Source)
	at javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
	at java.awt.Container.layout(Unknown Source)
	at java.awt.Container.doLayout(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validate(Unknown Source)
	at java.awt.Window.pack(Unknown Source)
	at flap_prototyp2.initComponents(flap_prototyp2.java:3626)
	at flap_prototyp2.<init>(flap_prototyp2.java:610)
	at flap_prototyp2.main(flap_prototyp2.java:12823)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: javax.swing.JTextField[,0,0,0x0,invalid,disabled,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1b2d7df,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=0,columnWidth=0,command=,horizontalAlignment=CENTER] is not attached to a horizontal group
	at javax.swing.GroupLayout.checkComponents(Unknown Source)
	at javax.swing.GroupLayout.prepare(Unknown Source)
	at javax.swing.GroupLayout.preferredLayoutSize(Unknown Source)
	at java.awt.Container.preferredSize(Unknown Source)
	at java.awt.Container.getPreferredSize(Unknown Source)
	at javax.swing.JComponent.getPreferredSize(Unknown Source)
	at javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
	at java.awt.Container.layout(Unknown Source)
	at java.awt.Container.doLayout(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validateTree(Unknown Source)
	at java.awt.Container.validate(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
```


----------



## André Uhres (11. Jun 2010)

Du hast eine null-Referenz (nicht initialisierte Variable) hier:
at flap_prototyp2.initComponents(flap_prototyp2.java:3626)

Aber über 12000 Codezeilen in einer .java Datei ist schon ziemlich heavy :shock: .


----------



## diggaa1984 (11. Jun 2010)

da kann man schonmal n nicht-initialisiertes objekt übersehen


----------



## Ebenius (11. Jun 2010)

André das stimmt nicht. In flap_prototyp2.java:3626 steht nur [c]window.pack()[/c] da ist nichts null.

Ein JTextField ist keiner horizontalen Group im Layout zugewiesen: 





			
				Zeile 47 hat gesagt.:
			
		

> javax.swing.JTextField […] is not attached to a horizontal group



Ebenius


----------



## André Uhres (12. Jun 2010)

Tipp: GroupLayout ist prinzipiell nur für visuelle Oberflächengestalter gedacht, um damit die Oberfläche per Mausklick "zusammenklicken". Für manuelle Oberflächengestaltung ist es eher ungeeignet, weil es zu kompliziert ist. Dafür gibt es genug benutzerfreundliche Layouts, wie z.B. Border-, Box-, Flow- und GridLayout. Diese kann man natürlich auch sehr gut in einer beliebigen Kombination/Verschachtelung verwenden.


----------



## NePec (12. Jun 2010)

Die 12000 Zeilen kommen daher, weil ich per Drag&Drop das Fenster konstruiert habe. Ich hab 300 Textfelder und 110 Labels in dem Fenster! Den Code hab ich vom Netbeans Designer übernommen...



Ebenius hat gesagt.:


> Ein JTextField ist keiner horizontalen Group im Layout zugewiesen



Erstmal Danke für die Mühe den Stack Trace durchzusehen!
Gibt es eine Möglichkeit dieses Textfeld zu finden? Denn bei 300 Textfeldern ist es ziemlich schwer, das nicht hinzugefügte zu finden!


----------



## André Uhres (13. Jun 2010)

NePec hat gesagt.:


> Den Code hab ich vom Netbeans Designer übernommen...
> ... bei 300 Textfeldern ist es ziemlich schwer, das nicht hinzugefügte zu finden!


Versuch's einfach ohne Netbeans Designer   .


----------



## Ebenius (13. Jun 2010)

Dazu kann ich jetzt leider auch nicht mehr viel sagen, weil ich den entsprechenden Code nicht kenne.

Ebenius


----------



## NePec (13. Jun 2010)

Ich mir den Code jetzt Zeile für Zeile durchgeschaut... jede Textfeld das ich erstellt habe, kommt auch im Code fürs Grouplayout vor!

Hier ist mal der komplette Code eines Grouplayouts:

```
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(list_jPanel7.get(size_all));
        list_jPanel7.get(size_all).setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(list_cb_Raum1.get(size_all))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(list_tf_Raum1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(list_cb_Raum1_Posten3.get(size_all))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_tf_Raum1_PosNr3.get(size_all)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(list_cb_Raum1_Posten2.get(size_all))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_tf_Raum1_PosNr2.get(size_all)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(list_cb_Raum1_Posten1.get(size_all))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_tf_Raum1_PosNr1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name3.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel3.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis3.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis1.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name2.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel2.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis2.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(list_cb_Raum1_Posten6.get(size_all))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_tf_Raum1_PosNr6.get(size_all)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(list_cb_Raum1_Posten5.get(size_all))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_tf_Raum1_PosNr5.get(size_all)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addComponent(list_cb_Raum1_Posten4.get(size_all))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_tf_Raum1_PosNr4.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(list_cb_Raum1_Posten8.get(size_all))
                                    .addComponent(list_cb_Raum1_Posten7.get(size_all))
                                    .addComponent(list_cb_Raum1_Posten9.get(size_all))
                                    .addComponent(list_cb_Raum1_Posten10.get(size_all)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(list_tf_Raum1_PosNr9.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                                    .addComponent(list_tf_Raum1_PosNr10.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                                    .addComponent(list_tf_Raum1_PosNr8.get(size_all), javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                                    .addComponent(list_tf_Raum1_PosNr7.get(size_all)))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name10.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel10.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis10.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name9.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel9.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis9.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name8.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel8.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis8.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name5.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel5.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis5.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name4.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel4.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis4.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name6.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel6.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis6.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(list_tf_Raum1_Name7.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(list_tf_Raum1_Formel7.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(list_l_Raum1_Ergebnis7.get(size_all), javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(list_cb_Raum1.get(size_all))
                    .addComponent(list_tf_Raum1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(list_cb_Raum1_Posten1.get(size_all))
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel1.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis1.get(size_all))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(list_cb_Raum1_Posten2.get(size_all))
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr2.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name2.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel2.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis2.get(size_all))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(list_cb_Raum1_Posten3.get(size_all))
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr3.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name3.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel3.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis3.get(size_all))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(list_cb_Raum1_Posten4.get(size_all))
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr4.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name4.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel4.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis4.get(size_all))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(list_cb_Raum1_Posten5.get(size_all))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(list_cb_Raum1_Posten6.get(size_all)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(list_tf_Raum1_PosNr5.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(list_tf_Raum1_Name5.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(list_tf_Raum1_Formel5.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(list_l_Raum1_Ergebnis5.get(size_all)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(list_tf_Raum1_PosNr6.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(list_tf_Raum1_Name6.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(list_tf_Raum1_Formel6.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(list_l_Raum1_Ergebnis6.get(size_all)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(list_cb_Raum1_Posten7.get(size_all))
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr7.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name7.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel7.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis7.get(size_all))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr8.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name8.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel8.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis8.get(size_all)))
                    .addComponent(list_cb_Raum1_Posten8.get(size_all)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(list_cb_Raum1_Posten9.get(size_all))
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_Name9.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel9.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis9.get(size_all)))
                    .addComponent(list_tf_Raum1_PosNr9.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(list_tf_Raum1_PosNr10.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Name10.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_tf_Raum1_Formel10.get(size_all), javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(list_l_Raum1_Ergebnis10.get(size_all)))
                    .addComponent(list_cb_Raum1_Posten10.get(size_all)))
                .addContainerGap(38, Short.MAX_VALUE))
        );
```

Wenn ich diesen Code mit Variablen anstatt der Listen verwenden funktioniert alles prima!
Der Code muss stimmen, hat ja mal funktioniert, alle Textfelder die ich zZ darin verwende sind deklariert und initalisiert, das size_all hat auch den richtigen Wert!

Ich weiß echt nicht mehr weiter... ;(


----------



## Ebenius (13. Jun 2010)

Hm. Das ist mir ein bisschen zu übersichtlich. Vorschlag: setze bei allen JTextFields den Namen [c]setName("eindeutiger Name")[/c]. Und dann lass den Fehler nochmal auftauchen und guck Dir die Ausgabe an. Dann steht der Name auch mit drin.

Ebenius


----------



## NePec (17. Jun 2010)

So, nach langem hin und her probieren hat das mit dem setName funktioniert!
Ich bekomme keine Fehler mehr!

Vielen Dank für eure Hilfe!

P.S.: mein nächsten GUI programmier ich mir selbst


----------



## Ebenius (17. Jun 2010)

NePec hat gesagt.:


> P.S.: mein nächsten GUI programmier ich mir selbst


Gute Idee.  

Ebenius


----------

