My container JPanel has a boxlayout. In the first row, another JPanel, two elements should be placed: a JLabel in the left and a JButton in the right.
How to place them there?
I can't use BorderLayout (so west and east) for the inner JPanel, because it would make the first row blow up taking the whole height which is really ugly.
In the first row, another JPanel, two elements should be placed: a JLabel in the left and a JButton in the right.
You can use a horizontal BoxLayout
for that and add "glue"
between the two components.
Read the section from the Swing tutorial on Using Invisible Components as Filler for more information.