I think CardLayout is the better choice.
Add both panels to a component which uses the CardLayout manager, which you initialized as private member like
this.localCardLayout = new CardLayout();
this.setLayout(localCardLayout);
this.add(identifierPanelA, panelA);
this.add(identifierPanelB, panelB);
where panelA and panelB are your panels and identifierPanelA and identifierPanelB are two different strings.
Initially this will show panelA, you can easily switch to panelB by calling the following method:
this.localCardLayout.show(this,identifierPanelB);
if you post some code it would be easier to track down your problem.
Nevertheless i recognized that i used a function call which may result in deprecated method in my example. Instead of
this.add(identifierPanelA, panelA);
this.add(identifierPanelB, panelB);
you should use
this.add(panelA, identifierPanelA);
this.add(panelB, identifierPanelB);