📄 drawpolygondemo.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 + -