public class MyFrame extends JFrame implements ActionListener{
/***********
other codes
*/
public MyFrame(){
JMenuItem item=new JMenuItem("跳转");
item.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
this.dispose();// 关闭MyFrame
new AnotherFrame();//打开AnotherFrame
}
public class AnotherFrame extends JFrame{
/****************/
}