I can't shed a lot of light. Just a little.
According to
this article: "One big difference between BoxLayout and many earlier layout managers is that BoxLayout respects each component's maximum size
and X/Y alignment."
My guess is that JRadioButtons have a default alignment of left, at the component level. A BoxLayout won't override that. If you want your radio buttons to be centered (although I have no idea why you'd want that), you'd have to use the setAlignmentY() method of your button instances.
The CENTER option used when adding to a BorderLayout simply dictates what "region" of the layout to put the component in--not how to align that component when it's in that region. Regions expand to fill up empty space, so if you don't have anything in your WEST or EAST regions, it will probably behave pretty much like a BoxLayout.
Okay, so why did they come out centered in the first version of your code? Not sure. Maybe because you never set up a layout manager for the panelTop JPanel? That will give it the default FlowLayout, which, from what I gather, does
not respect the components' own alignments.
That's a little unexpected, if you ask me. I wouldn't thought that the alignment in the layou the buttons were in would've taken precedence over the alignment in the layout of the "parent" container.
I'm curious to see what sort of other answers this question gets.
- Jeff