📄 502467d6b717001c1dc48a59085d713a
字号:
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class MainArea extends Frame {
public void launchFrame()
{
this.setLocation(100,100);
this.setSize(500,500);
this.setVisible(true);
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
}
public void paint(Graphics g)
{
Color c=g.getColor();
g.setColor(Color.RED);
for(int i=0;i<19;i++)
{
int t=100+i*10;
int t1=t+300;
g.drawLine(100,t,300,t);
}
//g.drawLine(100,100,200,200);
g.setColor(c);
}
public static void main(String[] args) {
MainArea ma=new MainArea();
ma.launchFrame();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -