📄 leverage.java
字号:
import java.awt.*;
public class leverage{
public leverage(int xPosition,int yPosition,boolean isDown){
x=xPosition;
y=yPosition;
Down=isDown;
}
public void draw(Graphics g){
if (Down){
g.setColor(Color.red);
g.drawRect(x,y,30,3);
g.fillRect(x,y,30,3);
}
else{
g.setColor(Color.red);
g.drawRect(x-30,y,30,3);
g.fillRect(x-30,y,30,3);
}
}
//set the value for Down
public void setDown(boolean flag){
Down=flag;
}
//get the value of Down
public boolean getDown(){
return Down;
}
int x;
int y;
boolean Down;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -