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

📄 gamepanel.java

📁 这是用java写的一个扫雷的小游戏程序。运行于windows2000希望大家喜欢
💻 JAVA
字号:
/* * GamePanel.java * * Created on April 20, 2005, 6:58 PM */package minegame;import java.awt.*;import java.awt.event.*;import javax.swing.*;/** * * @author hysun */public class GamePanel extends JComponent implements ActionListener, MouseListener {        private FieldCell[][] cells;        public static final Color ACTIVE_COLOR = Color.blue.darker();    public static final Color VICTORY_COLOR = Color.green.darker();    public static final Color OVER_COLOR = Color.red.darker();        private JButton newButton;    private JLabel statusLabel1, statusLabel2;    private JPanel statusBar,panel;    private ConfigDialog cdialog;    private JFrame frame;        private JMenuBar mainMenu;    private JMenu gameMenu, helpMenu;     private JMenuItem setting ,newGame,  topHelp, aboutGame,exit;    private JTextArea help;     private JScrollPane scrollHelp;        private int mineNum;    private int r, c;    private int w, h;    private int flagNum, revealNum, totalNum;        private static boolean gameActive ;        public GamePanel() {        statusBar = new JPanel();        panel = new JPanel();             panel.setLayout(new BorderLayout());        statusBar.setLayout(new FlowLayout(FlowLayout.CENTER));        ImageIcon img = new ImageIcon(this.getClass().getResource("29.gif"));        newButton = new JButton(img);            newButton.setPreferredSize(new Dimension(23, 23));        statusLabel1 = new JLabel();        statusLabel2 = new JLabel();        statusBar.add(statusLabel1);        statusBar.add(newButton);        newButton.addActionListener(this);         statusBar.add(statusLabel2);                    mainMenu = new JMenuBar();         gameMenu = new JMenu("村栏(G)");         helpMenu = new JMenu("弧

⌨️ 快捷键说明

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