📄 mybutton.java
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -