Results 1 to 2 of 2
- 04-12-2008, 07:34 PM #1Member
- Join Date
- Dec 2007
- Rep Power
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.
Swing containers should have add and remove methods. You already know how to call add..
But for your purpose, it looks like a wizard framework is best option for you. With these frameworks you can create wizards similar to installation wizard of programs.
Check this document for further details:
java.net: Using the Wizard API
- By jamesfrize in forum Java AppletsReplies: 3Last Post: 03-20-2008, 05:35 PM
- By Lehane_9 in forum AWT / SwingReplies: 1Last Post: 03-06-2008, 05:22 PM
- By vargihate in forum AWT / SwingReplies: 2Last Post: 01-04-2008, 05:09 AM
- By plodos in forum New To JavaReplies: 2Last Post: 12-10-2007, 09:02 AM
- By ramachandran in forum New To JavaReplies: 1Last Post: 10-25-2007, 09:05 AM