mybutton.java
来自「扫雷系统:和平时的玩法差不多;设定难度」· Java 代码 · 共 51 行
JAVA
51 行
// Class Description: The MyButton class is created for a new Button,
// MyButton can provide some operation such as Button Statues,Button
// position, whether the button is visited, to return the sum Mines
// of the button in 8 directions.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MyButton extends Button{
private boolean Status; //whether the button is mine,yes,Status=false
private int pos; //position
private boolean visit=false;
private int jishu; //total Mine in 8 directions
public boolean GetStatus()
{
return this.Status;
}
public void SetStatus(boolean param)
{
Status=param;
}
public void SetPos(int val)
{
pos=val;
jishu=0;
}
public int GetPos()
{
return this.pos;
}
public void setVisit()
{
visit=true;
}
public boolean getVisit()
{
return this.visit;
}
public void increment()
{
jishu++;
}
public int getCount()
{
return jishu;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?