I have a BoxLayout panel that has some components from top to bottom and I want this to be centered (both vertically and horizontally) in the content pane, so that when I maximize the window this inner panel will still remain at its center.
I've managed to do this with BoxLayout and/or GridBagLayout, but since I'm experimenting with Swing I was wondering if I can do the same by using FlowLayout or BorderLayout as the content pane's layout manager. I couldn't find a way to do it... When I maximize the frame the inner panel remains centered horizontally but not vertically (it's stuck at the top).
Can it be done with these 2 layout managers or I'm wasting my time?