How to change item position in a Dialog box.

There is dialog box which has two items as following:
  AAA:  AAA ComboBox
  BBB:   BBB  ComboBox

I want to change it in the dialog as the following:
 AAA:  AAA ComboBox     BBB:   BBB  ComboBox

Could you help me to reslove it? My codes is as following:

final PanelBean centerPanel = new PanelBean(new SpringLayout());

final LabelBean AAALabel = new LabelBean(AAA_TEXT);
AAALabel.setHorizontalAlignment(LabelBean.RIGHT);
centerPanel.add(AAALabel);

....
AAACombo = new PreferencableComboBoxBean( studentAAAStructs, AAA_STUDENT_ETC_COMBOBOX_PREF_KEY_STRING, "0" );

final PanelBean AAAFlowPanel = new PanelBean( new FlowLayout(FlowLayout.LEFT, 0, 0) );
Dimension prefSize = AAACombo.getPreferredSize();
AAACombo.setPreferredSize( new Dimension(185, prefSize.height) );
AAAFlowPanel.add( AAACombo );
centerPanel.add( AAAFlowPanel );


final LabelBean BBBLabel = new LabelBean(BBB_TEXT);
BBBLabel.setHorizontalAlignment(LabelBean.RIGHT);
centerPanel.add(BBBLabel);
.....
BBBCombo = new PreferencableComboBoxBean( BBBTypes, BBB_ETC_COMBOBOX_PREF_KEY_STRING, "0" );
final PanelBean BBBFlowPanel = new PanelBean( new FlowLayout(FlowLayout.LEFT, 0, 0) );
Dimension BBBPrefSize = BBBCombo.getPreferredSize();
BBBCombo.setPreferredSize( new Dimension(185, BBBPrefSize.height) );
BBBFlowPanel.add( BBBCombo );
centerPanel.add( BBBFlowPanel );


Thanks.
StevenZhangAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sciuriwareCommented:
Could you forget about SpringLayout and use a HorizontalBox,
with 'glue' and 'struts' you can position those 6 components as fine as you want:

    Box panel = Box.createHorizontalBox();
.......
    panel.add(AAAlabel);
    panel.add(Box.createHorizontalStrut(12)); // 12 is just a guess.
    panel.add(AAAfield); // What ever that is ...
    panel.add(Box.createHorizontalStrut(12));
    panel.add(AAAcomboBox);
    panel.add(Box.createHorizontalGlue); // variable distance to the 2nd group, depends on the total space.
.....
and so on.

;JOOP!
StevenZhangAuthor Commented:
I used SpringLayout to resolve it by myself. Anyway, Thanks.
StevenZhangAuthor Commented:
The soultion is to re-arrange the panels, then adjust the parm of the following function.

SpringUtilities.makeCompactGrid(centerPanel,                                          2, 4,
                  5, 5,
                  5, 5);

Anyway, Thanks.
GhostModCommented:
PAQed with points refunded (50)

GhostMod
Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.