📄 minebutton.java
字号:
package cleanMine;
import java.awt.Insets;
import javax.swing.JButton;
public class MineButton extends JButton
{
int row;
int col;
int isMines;
boolean changD=false;
boolean flagd=false;
public boolean isFlagd() {
return flagd;
}
public void setFlagd(boolean flagd) {
this.flagd = flagd;
}
public boolean isChangD() {
return changD;
}
public void setChangD(boolean changD) {
this.changD = changD;
}
public MineButton(int x_,int y_)
{
row=x_;
col=y_;
this.setMargin(new Insets(0,0,0,0));//使边距都为0
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public int getCol() {
return col;
}
public void setCol(int col) {
this.col = col;
}
public int getIsMines() {
return isMines;
}
public void setIsMines(int isMines) {
this.isMines = isMines;
show();
}
public void show()
{
this.setText(isMines+"");//+""是得isMinse自动转换为字符串
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -