Below is a screenshot of a GUI I created with Java Swing and MigLayout as the main layout manager. "Game Board" has kept its smallest possible size, but this is not desired behavior. I'd want this JPanel
to stretch all the way to the right and bottom.
Why isn't the layout behaving as I expect it? Can I change this behavior?
Here's the relevant code from the main window:
_frame.setLayout(new MigLayout());
_frame.getContentPane().add(_board);
_frame.getContentPane().add(_cardPick, "wrap, span 2 1");
_frame.getContentPane().add(_regList);
_frame.getContentPane().add(_chkPowerdown, "gapleft 15, align left bottom");
_frame.getContentPane().add(_btnSubmit, "gapleft 15, wrap, align left bottom");
_frame.pack();
The first three components all have a TitledBorder
. They're custom-made JPanel
s with a MigLayout
.