oval.java

来自「一个简单的JAVA绘图程序」· Java 代码 · 共 31 行

JAVA
31
字号
//********************************************************************
//  Oval.java       Author: Lewis and Loftus / Peter DePasquale
//
//  Refinement #2
//
//  Represents and oval shape in the PaintBox application.
//********************************************************************

import java.io.*;
import java.awt.*;

public class Oval extends BoundedShape
{
   //-----------------------------------------------------------------
   //  Sets up the oval's color, position, and size.
   //-----------------------------------------------------------------
   public Oval (Color color, Point corner, int wide, int high)
   {
      super (color, corner, wide, high);
   }

   //-----------------------------------------------------------------
   //  Draws the oval.
   //-----------------------------------------------------------------
   public void draw (Graphics page)
   {
      page.setColor (strokeColor);
      page.drawOval (upperLeft.x, upperLeft.y, width, height);
   }
}

⌨️ 快捷键说明

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