I'm developing a game as college work, I've a fully autonomus panel that handles all process of the game, but I want to add a menu that allows to select the differents levels and difficulties, and there's the problem. I only have one frame, so I've to manage two panels in this. How can I change the panels? I've read something about CardLayout, but I don't know if it's that I need really. I'm doing tests adding and removing the panels , but It doesn't work fine. How can I do it?
Edit I think that the problem is the previous panel is not removed, so the add/remove way doesn't work.