I'm having trouble positioning elements in a JPanel
. I tried using GridBagLayout
but that doesn't seem to make any of the parts of the panel GUI components move. What should I do?
panel.add(Label);
panel.add(TextField);
panel.add(Label);
panel.add(JChooser);
Nothing seems to help move these GUI elements. They just act like they are in a FlowLayout
. What should I do? I'm using a CardLayout
for another panel (that panel holds other panels like this one in it), but this panel, I need to align them to the left.
The Label
and TextField
need to be on the same line, but the Label
and JChooser
need to be on a different line.
Example:
SomeLabel : [ TextField ]
SomeLabel : [Chooser]
I hope I explained well enough.