0
.addGroup(makeBookingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel48)
                            .addComponent(sittingPull, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bookingTime2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

I'm trying to place bookingTime2 after sittingPull, to the right. I realise with the current parameters I'm placing them in the same place. I don't understand default_size or preferred_size though. How do I change these parameters to achieve what I want?

Chucky
  • 1,701
  • 7
  • 28
  • 62

1 Answers1

1

you have (last two code lines in void or contructor) call for JComboBox's container

Xxx.revalidate();
Xxx.repaint();
mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • Can you explain what you mean? – Chucky Mar 24 '12 at 10:32
  • [please test how Swing Container works, how LayoutManagers works, what's happened on events add/remove JComponent(s) on runtime](http://stackoverflow.com/a/9675993/714968) – mKorbel Mar 24 '12 at 10:37
  • +1 Useful for dynamic layout, but OP just wants to add the combo to an existing `GroupLayout`. – trashgod Mar 24 '12 at 13:32
  • @trashgod hard to say something wise but I don't see there something different in compare with rest of Standard LayoutManagers, but required wrote engine by hands, not by Netbeans generated code, I hope that I'm correct... – mKorbel Mar 24 '12 at 16:28
  • @mKorbel: I can't see whether the OP is modifying a horizontal or vertical group, but both are required. The symbol `bookingTime2` is stereotypical of the GUI designer, but OP may not have the corresponding `*.form` file. – trashgod Mar 24 '12 at 18:26