📄 line.java
字号:
import java.awt.*;
public class Line extends Shape {
public Line()
{
super();
}
public Line( int x1, int y1, int x2, int y2 )
{
super( x1, y1, x2, y2 );
}
public void draw( Graphics g )
{
Color c = g.getColor(); // get previous color
g.setColor( this.getColor() );
g.drawLine( getX1(), getY1(), getX2(), getY2() );
g.setColor( c ); // reset previous color
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -