What is the proper way to swap out an existing JPanel in a JFrame with another?

后端 未结 3 1025
天涯浪人
天涯浪人 2020-12-22 04:00

I\'m building a program that requires swapping out the current, visible JPanel with another. Unfortunately there seems to be multiple to go about this and all of my attempts

3条回答
  •  长情又很酷
    2020-12-22 04:28

    that requires swapping out the current, visible JPanel with another

    Have a look at CardLayout for a complete example of how to do it properly.

提交回复
热议问题