📄 confirmdialog.java
字号:
import javax.swing.*;
public class ConfirmDialog {
Game game;
private int symbol;
public ConfirmDialog(Game in){
game=in;
symbol=JOptionPane.showConfirmDialog(null,"Are you sure to quit the game ?","Exit Game ",JOptionPane.YES_NO_CANCEL_OPTION);
decide();
}
public void decide(){
if(symbol==JOptionPane.OK_OPTION)
System.exit(0);
if(symbol==JOptionPane.CANCEL_OPTION){
}
if(symbol==JOptionPane.CLOSED_OPTION){
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -