?? minegame.java
字號:
/*
* MineGame.java
*
* Created on 2007年8月21日, 上午11:38
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package minegame;
/**
*
* @author linda
*/
public class MineGame extends javax.swing.JFrame {
/** Creates new form MineGame */
public MineGame() {//構造方法
initComponents();//初始化
getContentPane().add(gamePanel1.panel(), java.awt.BorderLayout.NORTH);//菜單面板放在最上方
getContentPane().add(gamePanel1.getStatusBar(), java.awt.BorderLayout.CENTER);//狀態條面板放在中間
pack();//調整此窗口的大小,以適合其子組件的首選大小和布局。
setLocationRelativeTo(null);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
gamePanel1 = new minegame.GamePanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);//設置默認窗口關閉操作
setTitle("Java掃雷");//設置窗口標題
getContentPane().add(gamePanel1, java.awt.BorderLayout.SOUTH);//主面板放在下方
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.util.Locale.setDefault(java.util.Locale.US);
java.awt.EventQueue.invokeLater(new Runnable() {//啟動主線程
public void run() {
new MineGame().setVisible(true);
}
});
}
private minegame.GamePanel gamePanel1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -