Here you clearly cannot see any values from the table. Therefore, how to grow the table so that each value can be seen?
As I've said in my comment, I don't think your problem is about columns (preferred | min | max) sizes but the default behavior of your layout manager: MigLayout. As stated in this answer by default rows in MigLayout
doesn't fill all available width but just the necessary to display the longest row (based on components width). You can see this fact if you enable "debug" feature when you instantiate your layout:
MigLayout layout = new MigLayout("debug");
As I understand your question you need a combination of both growx
and fillx
constraint. The first one is a component constraint and the other one is a layout constraint.
That being said, pelase consider the following progression.
1. Adding scroll pane without "growx" constraint
Snippet
MigLayout layout = new MigLayout("debug");
JPanel panel = new JPanel(layout);
panel.add(buttonsPanel, "wrap");
panel.add(scrollPane);
Screenshot
2. Adding scroll pane with "growx" constraint
Snippet
MigLayout layout = new MigLayout("debug");
JPanel panel = new JPanel(layout);
panel.add(buttonsPanel, "wrap");
panel.add(scrollPane, "growx"); // Note "growx" here
Screenshot
3. Adding scroll pane with "growx" and "fillx" contraints
Snippet
MigLayout layout = new MigLayout("debug, fillx"); // Note "fillx" here
JPanel panel = new JPanel(layout);
panel.add(buttonsPanel, "wrap");
panel.add(scrollPane, "growx"); // Note "growx" here
Screenshot
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…