⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawpolygondemo.java

📁 java 完全探索的随书源码
💻 JAVA
字号:
// DrawPolygonDemo.java

import java.awt.*;
import java.applet.Applet;

public class DrawPolygonDemo extends Applet
{
   public void paint (Graphics g)
   {
      // Get the width and height of the applet's drawing surface.

      int width = getSize ().width;
      int height = getSize ().height;

      int [] xp1 = { 30, 120, 70 };
      int [] yp1 = { 90, 30, 110 };

      g.drawPolygon (xp1, yp1, xp1.length);

      int [] xp2 = { 90, 170, 130 };
      int [] yp2 = { 150, 120, 150 };

      g.drawPolyline (xp2, yp2, xp2.length);

      int [] xp3 = { 130, 170, 150 };
      int [] yp3 = { 50, 90, 120 };

      g.fillPolygon (xp3, yp3, xp3.length);
   }
}

⌨️ 快捷键说明

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