Believe I found the answer at Pearson informIT website article by Jeff Friesen 9/22/2006 at
Harness the Power of Java's GridBagLayout. On page 2 he gives 10 examples of code and the GUI they create. (buildGUI8 is the one where he addresses my problem)
assigning a positive integer to gridwidth (and also to gridheight) to increase the display area can be problematic.
Unless components surround a component whose display area is to be increased, GridBagLayout doesn’t increase the size of the display area.
... corrects the problem.. by surrounding button 1 (on the right and below) with four button components.
GridBaglayout checks for a button immediately to the right of, on each row of, immediately below, and on each column of the display area for button 1. The presence of these buttons results in button 1 obtaining (and sizing to) its two-row by two-column display area
I've never seen this documented anywhere else, but can confirm that behavior still exists in
Java 8 in 2015. IMHO one of the reasons for the bad reputation that GridBagLayout seems to have earned.
Code below creates 6 panels in GridBagLayout. Each panel has buttons arranged around a Big button. I use GridBagLayout to size the Big button to 2x2 cells, the remainder of the buttons at 1x1. Text on the buttons is consistent with where should be placed, and (n,n) are (gridx, gridy) used to place each button.
Panel 1: placed a button in first position at (0,0), with Big button below it at (0,1). Another button to right of Big button at expected location (2,1) which would be top right of Big button. Surprisingly, it ignores the 2x2 size for Big button and only makes it 1x1!
Panel 2: place 2 buttons across top at (0,0) and (1,0). Then Big button next row below at (0,1). The Big button expands across the 2 columns as expected, but still refuses to grow in height
Panel 3: place Big button first at (0,0). Then 2 buttons along right hand side at (2,0) and (2,1). Big button now expands vertically to accommodate the 2 buttons to its right, but now won't expand horizontally.
Panel 4: add panel 2 and panel 3 together with 2 across top and 2 to right of Big button, and now it expands to the expected 2x2 cell size. Surrounded it grows.
Panel 5: doesn't matter if you put the other buttons to left or right, and top or bottom, long as both sides are covered. Requiring it to be surrounded is not the behavior I would have expected and quite confusing.
Panel 6: here I placed Big button first, and then placed the other two buttons assuming big button takes 2x2 cells. So Four is on 2nd row down and 3rd column over, Six is 3rd row down and 2nd column over. Refuses to expand Big button at (0,0), so places Four at (1,0) and Six at (0,1).
So it seems you have to fill all the cells across on at least one row, and all the cells down in one column, somewhere in you GridBagLayout for it to function. A lot of other behavior to investigate - can you leave holes in the middle, do the rows have to be immediately adjacent to something that you want to expand, or can they be separated by a few shorter rows, etc. Now I can't trust GridBagLayout to do anything without carefully checking. What do I use to fill in the dummy rows/cols? I found that if you set the buttons to setInvisible(true) the interface acts as if they aren't there (i.e. if you take panel 4 and set Three and Four invisible, you get Panel 2). So if you change visibility during program execution, things could dance around like crazy.
I left out changes to fill and anchor to investigate also. I set everything to fill=BOTH to make it easier to see what size the cells were.
I found an example of how to use gridBagLayout.getLayoutDimensions() to return a 2D array of integers showing the row heights, column widths, horizontal weights, and vertical weights for each cell in the layout. This might help figure out what the layout manager is seeing and doing. I'll post that separately since this is already so long.