Problems with aligning JButtons, from NetBeans generated code

Hey! I'm working on my Computer Science Dossier, and I can't figure out how to allign two buttons in a single row. Right now, they are diagonally placed next to one another, but in two different rows. Help !

Here's part of the code:

.add(30, 30, 30)

.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)

.add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 300, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))

.add(460, 460, 460))

.add(layout.createSequentialGroup()

.add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 900, Short.MAX_VALUE)

.addContainerGap())))

.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()

.addContainerGap(100, Short.MAX_VALUE)

.add(b1) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)

.add(b2)

.addContainerGap(100, Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)

.add(layout.createSequentialGroup()

.addContainerGap()

.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)

.add(jLabel2)

.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)

.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)

.add(jLabel1)

.add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)

.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)

.add(b1)

.add(b2)

.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

);

}

[2241 byte] By [MiziaQa] at [2007-11-26 18:28:32]
# 1
use an IDE like netbeans to design the GUIs visually :D
grilleda at 2007-7-9 6:02:43 > top of Java-index,Desktop,Core GUI APIs...
# 2
> use an IDE like netbeans to design the GUIs visually> :DI would not recommend this unless you already know how to do it by hand.
zadoka at 2007-7-9 6:02:43 > top of Java-index,Desktop,Core GUI APIs...
# 3
I know..I did that, but I had to modify the code to add more columns to my JTable. Now my buttons aren't in place :(
MiziaQa at 2007-7-9 6:02:43 > top of Java-index,Desktop,Core GUI APIs...