Switching between JPanels

后端 未结 3 1212
梦谈多话
梦谈多话 2021-01-21 01:58

I\'m trying to make a game. There\'s several different screens in the game such as a main menu, and the actual game screen. Each of these is a separate jpanel extension. I have

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-21 02:40

    You can do a number of different things to achieve the same effect.

    The first suggestion I'd make is use CardLayout (How to Use CardLayout) as this is what it was designed to do.

    The other would be to use a JTabbedPane (How to use Tabbed Panes)

提交回复
热议问题