'Java JFrame Border Layout - Is it possible to interchange the 'CENTER' with a different panel?

So firstly im new to Java and am learning as I go at this point.

I briefly made a Calculator/Scientific Calculator following guides a while ago which I enjoyed. The way it was done had me wondering if as I stated above, whether it is possible in the Border Layout to interchange the Center with another frame.

For the sake of an example, lets say I wanted to make a simple calculator for my nephew, one that has all numerical buttons but only the + and = buttons, so he can get used to addition. Now would it be possible by using a menu button action performed to actually swap out the above with a similar but different frame, again for the sake of an example one with only the - and = buttons.

I know I can add another frame to the left/right with this, just not whether I can actually replace it fully.

If its possible please let me know, that or any options available using different layout managers would be great!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source