テトリスゲームを書いています。アプリケーションがJlabelを起動すると、「再生」ボタンが開きます。既存のJframe内で別のラベル(ボード)に切り替えるにはどうすればよいですか?
このように、ゲームを直接開きます。しかし、最初にButtonPageクラスを使用して、代わりにボタン付きのウェルカム画面を表示してから、ゲームを呼び出します。
    public class Tetris extends JFrame {
    public Tetris(){
        // JFrame Properties
        setSize(198, 409);  
        setResizable(false);
        setTitle("Tetris");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
//        ButtonPage buttons = new ButtonPage();
//        add(buttons);
//        buttons.setOpaque(true);
        Board board = new Board(this);
        add(board);
        board.start();
    } // end of constructor 
    public static void main(String[] args){
        Tetris game = new Tetris();
        game.setLocationRelativeTo(null);        
        game.setVisible(true);        
        game.setLayout(null);
    } // end of main
} // end of class
これがButtonPageクラスです。
public class ButtonPage extends JPanel implements ActionListener{
    JButton buttonPLAY = new JButton();
    JLabel backgroundImage = new JLabel();
    public ButtonPage(){  
        setLayout(null);
        ImageIcon buttonIcon = new ImageIcon(getClass().getResource("PlayButton.png"));
        ImageIcon buttonIconHover = new ImageIcon(getClass().getResource("PlayButtonHover.png"));
        ImageIcon buttonIconClicked = new ImageIcon(getClass().getResource("PlayButtonClicked.png"));
        int buttonHeight = buttonIcon.getIconHeight();
        int buttonWidth = buttonIcon.getIconWidth();
        buttonPLAY.addActionListener(this);
        buttonPLAY.setActionCommand("Play"); 
        buttonPLAY.setIcon(buttonIcon);
        buttonPLAY.setRolloverIcon(buttonIconHover);
        buttonPLAY.setPressedIcon(buttonIconClicked);
        buttonPLAY.setBorderPainted(false);        
        add(buttonPLAY);
        Dimension size2 = getSize();         
        Dimension size = buttonPLAY.getPreferredSize();
        buttonPLAY.setBounds((192 - buttonWidth)/2, 100 ,buttonWidth, buttonHeight);
    }// end of constructor
    @Override
    public void actionPerformed(ActionEvent e) {
        if ("Play".equals(e.getActionCommand())) {
        Tetris game = new Tetris();        
        // opens the window in the middle of the screen
        game.setLocationRelativeTo(null);
        // set the tetris window visible, unless its true - its invisible DUH!
        game.setVisible(true);        
        game.setLayout(null);
        }
    } // end of actionPerformed
}// end of class
actionPerformedメソッドを使用すると、新しいフレームでゲームを開くことができますが、パネルを切り替える方法がわかりません。
ヒントを事前に感謝します!