You can use Container.remove() to remove things from the GUI, then add things in their place. Make sure you invoke vaidate() on the container to run the layout manager when you're done rearranging things.
Thank you very much. I've used the validate(), remove() things and it works well. But using card layout is also a good choice. I might change to that alternative if there is any problem with my program later.