I’ve been playing around with GridBagLayout and I can’t seem to figure out how many pixels I’m going to get with a particular weighting in the constraints.
For example, say I have a 1000 pixel contentPane with three JPanels in it, with weights (say, weighty) of 0.1, 0.1, 0.8.
My first hypothesis was that panel 1 and 2 would be 100 pixels each, and panel 3 would be 800. Turns out it wasn’t.
How can I get an exact number of pixels to expect with respect to the weighting?
This question asks sort of the same thing, but the answers, while helpful, don’t answer the question. :- /
Never mind, I think I found the answer here:
Apparently the problem is extra space being added to the cells.