📄 drawlinepointdemo.java
字号:
// DrawLinePointDemo.java
import java.awt.*;
import java.applet.Applet;
public class DrawLinePointDemo 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;
g.drawLine (0, 0, width - 1, height - 1);
g.drawLine (0, height - 1, width - 1, 0);
int centerX = width / 2;
int centerY = height / 2;
for (int row = -5; row < 5; row++)
for (int col = -5; col < 5; col++)
g.drawLine (centerX + col, centerY + row,
centerX + col, centerY + row);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -