jminebutton.java

来自「在java平台上开发的扫雷小游戏」· Java 代码 · 共 51 行

JAVA
51
字号
/**
 * This program is written by Zhang Jianfeng use the technology of
 * SWING GUI and the OO design
 * 
 * @author Zhang Jianfeng all rights reserved.
 * Email:Zhang Jianfeng@cognizant.com; Zhang Jianfeng@yahoo.com.cn
 * Please report bug to these emails.
 * Open source under GPLv3
 * 
 * version 1.2
 */

import javax.swing.ImageIcon;
import javax.swing.JButton;

public class JMineButton extends JButton {
	private int col;
	private int row;
	private int flag = 0;
	private boolean clickFlag = false;

	JMineButton(int row, int col, ImageIcon icon) {
		super(icon);
		this.row = row;
		this.col = col;
	}

	public boolean getClickFlag() {
		return (clickFlag);
	}

	public void setClickFlag(boolean toSet) {
		clickFlag = toSet;
	}

	public int getCol() {
		return (col);
	}

	public int getRow() {
		return (row);
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	public int getFlag() {
		return (flag);
	}
}

⌨️ 快捷键说明

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