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

📄 minegame.java

📁 扫雷游戏实现
💻 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 + -