rectangle.java

来自「金旭亮的java教案」· Java 代码 · 共 25 行

JAVA
25
字号
import java.awt.*;

public class Rectangle extends BoundedShape {
   public Rectangle()
   {
      super();
   }

   public Rectangle( int x1, int y1, int x2, int y2 )
   {
      super( x1, y1, x2, y2 );
   }

   public void draw( Graphics g )
   {
      Color c = g.getColor();
      g.setColor( this.getColor() );
      g.fillRect( getUpperLeftX(), getUpperLeftY(),
                  getWidth(), getHeight() );
      g.setColor( c );
   }
}


 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?