Java 无法实现跳转界面后 删掉原界面

问题遇到的现象和发生背景 Java 无法实现跳转界面后 删掉原界面
问题相关代码,请勿粘贴截图

public class Game extends JFrame implements ActionListener {
Pane my = null;
JMenuBar menu = new JMenuBar ();
public Game() {
JMenu command = new JMenu("命令");
command.addActionListener(this);
menu.add(command);
this.setJMenuBar(menu);
JMenuItem re=new JMenuItem("重开");
JMenuItem se=new JMenuItem("地图2");
command.add(re);
command.add(se);
re.addActionListener(this);
se.addActionListener(this);
my = new Pane();
Thread thread = new Thread(my);
thread.start();
this.add(my);
this.addKeyListener(my);
this.setSize(1000, 750);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}

public static void main(String[] args) {
    // TODO Auto-generated method stub
   Game one = new Game();
}
public void actionPerformed(ActionEvent e) {

    // TODO Auto-generated method stub

    if(e.getActionCommand() == "重开");
       
    {
    this.dispose();
    new Game();

          }
    if(e.getActionCommand() == "地图2") {
        this.dispose();
        new Game2();
    }

    }

}

img

运行结果及报错内容 为什么在左上角的命令点击重开后能把Game1给删掉 同时在生成一个Game1 点击地图二却没有删掉Game1 直接Game1和Game2一起运行
我的解答思路和尝试过的方法 加dispose 在 "重开" 中起作用 "地图二"不起作用
我想要达到的结果 在Game1界面的命令中点击地图二 能够删除Game1 同时新生成Game2