Solved - Strange behaviour in NetBeans 5.5 (and SE 6)
I am using NB 5.5 and I created a new JInternalFrame and choose Free Design then it created the Layout like following (works perfectly this way):
javax.swing.GroupLayout caixaOcorrenciaLayout =new javax.swing.GroupLayout(caixaOcorrencia);
caixaOcorrencia.setLayout(caixaOcorrenciaLayout);
caixaOcorrenciaLayout.setHorizontalGroup(
caixaOcorrenciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, caixaOcorrenciaLayout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(caixaOcorrenciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,false)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING))
.addGap(16, 16, 16)
.addGroup(caixaOcorrenciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(cbOcorrencia, javax.swing.GroupLayout.Alignment.LEADING, 0, 461, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, caixaOcorrenciaLayout.createSequentialGroup()
.addComponent(campoNumeroNota, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 89, Short.MAX_VALUE)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(campoCNPJ, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, caixaOcorrenciaLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(caixaOcorrenciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(campoTextoLivre, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
.addGroup(caixaOcorrenciaLayout.createSequentialGroup()
.addComponent(calData, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(campoHora, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cbObservacao, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGap(12, 12, 12))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, caixaOcorrenciaLayout.createSequentialGroup()
.addContainerGap(421, Short.MAX_VALUE)
.addComponent(btnConfirmar, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
But when I added a JPanel to a JTabbedPane (in an old JInternalFrame I had already) and choose Free Design, it created the Layout as following:
org.jdesktop.layout.GroupLayout painelOcorrenciaLayout =new org.jdesktop.layout.GroupLayout(painelOcorrencia);
painelOcorrencia.setLayout(painelOcorrenciaLayout);
painelOcorrenciaLayout.setHorizontalGroup(
painelOcorrenciaLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(painelOcorrenciaLayout.createSequentialGroup()
.add(20, 20, 20)
.add(jLabel42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 110, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 300, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
I dont want to use JDesktop, I want to use the Swing package, but what can I do since NB does that (the codification) by it self?
Thanks
F.
Message was edited by:
Franzisk

