📄 menuhandler.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 + -