Originally posted by Martin Vietor:
Hello again,
I have two JPanels (GridLayouts), one has 15 JCheckBoxes, the other 13. Both have a JButton at the Bottom. I would like the CheckBoxes in each JPanel to be at the same Height (just looks prettier) and both Buttons at the very Bottom. I have achieved this by
Pragmatic. Not very elegant. Is there a way?
Well you can leave the
string out and just do
new JLabel(), or you can use something like
Box.createHorizontalStrut(0).
If you don't like using components as spacers, you can put the GridLayout panel in NORTH of a BorderLayout and put the buttons in a SOUTH panel. That's probably what I would have done.
You mention GridBagLayout. While that should work, I wouldn't recommend it.