Using CardLayout in Java
问题 I'm currently trying to make a game with a menu. Menu looks like this. http://puu.sh/xGoC Ideally, when I push a button, it will bring me to the game. The game looks like this. http://puu.sh/xGoV I currently initialize a JFrame() in my main class which runs either the menu class or the game class (Both of which are JPanels). How would I go about using CardLayout to make it so that I can initialize the game menu and when I click a button, change the panel to the game panel? 回答1: I've got some