📄 block.java
字号:
import java.awt.*;
import java.awt.event.KeyEvent;
public class Block {
public static final int BLOCKWH = 20;
int x ,y ;
private Color c;
public Block(int x,int y,Color c){
this.x = x;
this.y = y;
this.c = c;
}
public void Draw(Graphics g){
Color tmpc = g.getColor();
g.setColor(c);
g.fillRect(x, y, BLOCKWH, BLOCKWH);
g.setColor(tmpc);
}
public Rectangle getRect() {
return new Rectangle(x, y, BLOCKWH , BLOCKWH);
}
public Color getC() {
return c;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -