📄 drawpolylinetest.java
字号:
import java.awt.*;
public class DrawPolylineTest extends Canvas
{
int x[] = {40, 70, 100, 100, 70, 40, 10, 10};
int y[] = {10, 10, 40, 70, 100, 100, 70, 40};
public static void main(String argv[])
{
DrawPolylineTest d = new DrawPolylineTest();
Frame f = new Frame("DrawPolylineTest");
f.add(d, BorderLayout.CENTER);
f.pack();
f.setVisible(true);
}
public DrawPolylineTest()
{
setSize(110,110);
}
public void paint(Graphics g)
{
g.drawPolyline(x, y, 8);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -