📄 j_picture.java
字号:
//J_Picture.java
//Created by Zhou Chuanle
//
//Readme
//use java to draw a picture
import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;
public class J_Picture extends JApplet
{
Container m_container=null;
public void paint(Graphics g)
{
g.drawLine(20,30,60,90);
}//End of method paint
public static void main(String args[])
{
JFrame jf=new JFrame("Draw a picture");
J_Picture jp=new J_Picture();
jp.m_container=jf.getContentPane();
jf.setSize(500,300);
jf.setVisible(true);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
while(true)
jp.paint(jf.getGraphics());
}//End of method main
}//End of class J_Picture
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -