📄 drawapplet.java
字号:
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
/*
* Created on 2004-5-18
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class DrawApplet extends JApplet
{
public static void main(String[] args)
{
}
public void init()
{
this.setSize(600, 400);
start();
}
public void paint(Graphics g)
{
try
{
Thread.sleep(100);
} catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
g.setColor(Color.blue);
g.fillRect(100, 100, 100, 200);
g.drawRect(100, 300, 100, 100);
g.drawLine(100,150, 200, 150);
g.drawString("200", 205, 150);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -