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