Adding and removing panels dynamically
Apologies if this has already been answered, I looked back a few pages and didn't see anything on the topic.
I'm developing a system, in which the initial page allows a user to log on with username and password leading them to another screen. There are many ways to do this, i believe:
1. Set current JFrame to Invisible and create a new one
2. Set the current panel with login details to invisible and set the desired swing components within the panels you want to show to visible.
3. Remove the current panel and add in the necessary panels when logged in.
I'm guessing 3 is the best option but i don't know how to remove and add JPanels as necessary. If the code i have helps, I can upload. If this question has been asked before, please redirect me. Any advise would be helpful.