Judicious use of weightX values should solve your problem.
I haven't really looked into the weightx stuff, but I need to figure out exactly how it works and I'll have a fiddle with those.
Another possibility is that setting an appropriate prototype cell value for the jists (see the API for JList) would "freeze" their widths.
I'll give that a try.
If neither solves the problem completely, you may need to set a preferred size for each component.
That somehow slipped my mind. I'll give that a try too.
I use GridBagLayout all the time, but it requires some thought about how to set the constraints to cause the components to set where they should.
Looking at the concept, I assume you plan to use a JTree on the left and a JTable on the right, with a title area on top and messages below. So, you have three rows and two columns in your main JPanel. The 0 and 2 rows extend across the remaining rows. Use two JPanel's and set their preferred heights.
The pic I posted isn't a concept, it's a screenshot of what my program currently looks like. It's actually a JList on both sides, but that could change and is irrelevant anyway. So should I set up a 3x2 Grid layout with a panel in the left and another in the right? I quite like that idea.
In the 1 row, you have two areas, each in its own column. A nice approach is to fill both columns with a JSplitPane. If you do this, your main JPanel is down to one column. The JSPlitPane should take up the entire width and height.
I've never used a JSplitPane, but I'll have a look at that option.
You JTree and JTable can be larger than the space available, so use JScrollPane in each area of the JSplitPane. Put the JTree and JTable in those.
You can create only one constraints object, but modify it each time before you use it. You will need to reset the previous settings. Or, you can create a new one each time you add a component. Set the minimum number of constraint properties while achieving the desired result.
Instead of using the standard of setting each value, (c.gridx = ...) I kept the same 'c' object, but used the complete constructor each time, to be sure that no undesired values were being carried over...
Get your code to that point, and you will be able to ask more specific questions if it doesn't work.
Well, I never use gridbags. I use Boxes instead. I find I can lay things out easily using Boxes, and either let them resize, or fix their size also very easily. I've written hundreds of GUIs using nothing but Boxes for layouts.
I'll have a look at that option.