UI components (like JPanel) are the main view of things you see on the screen (location, parent, subcomponents, etc.), so each panel you see on screen should have a separate underline view, so you cannot add a panel to two different panels, you need to create two separate panels.
source
to share