📄 shape2.java
字号:
import java.awt.*;
import java.awt.geom.*;
public class Shape2 extends Frame{
public Shape2(String title){
super(title);
}
public void paint(Graphics g){
Graphics2D g2=(Graphics2D)g;
GeneralPath gp=new GeneralPath();
gp.moveTo(150,50);
gp.lineTo(150,250);
gp.lineTo(250,150);
gp.lineTo(50,150);
gp.closePath();
g2.draw(gp);
}
public static void main(String[] args){
Frame f=new Shape2("GeneralPath");
f.setSize(300,300);
f.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -