⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menuhandler.java

📁 java的扫雷程序
💻 JAVA
字号:
//Class Desccription:this class is used to implements he ActionListener
//                   to control the action of menuitem				
import java.awt.event.*;
import javax.swing.*;
public class MenuHandler implements ActionListener{
	public void actionPerformed(ActionEvent e){
		Object m=e.getSource();
		JMenuItem t=new JMenuItem("");
		if(m instanceof JMenuItem){
		    t=(JMenuItem)m;
		}
		if(t.getText()=="Description"){
			JOptionPane.showMessageDialog(MainClass.frame,"In this game,you will" +
					" experience the new-type mineSweeper,you can only win " +
					"by finding all the mines by chick the right mouse " +
					"to mark them","Description",JOptionPane.INFORMATION_MESSAGE);
		}
		else if(t.getText()=="Restart")
		{
			String[] s=new String[10];
			MainClass.frame.dispose();
			MainClass.main(s);
		}
		else{
			MainClass.frame.dispose();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -