face.java
来自「包括Rect,Circle两个类」· Java 代码 · 共 27 行
JAVA
27 行
// Face: face with draw, moveRight, and act functionality
import java.awt.*;
public class Face extends Shape
{
private int size;
public Face( int x, int y, int s )
{
super( x, y );
size = s;
}
public void act()
{
size += 2;
}
public void draw( Graphics g )
{
g.drawOval( xpos, ypos, size, size );
g.drawLine( xpos + 5, ypos + size - 5, xpos + size - 5, ypos + size - 5 );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?