⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 raindrop.java

📁 外文网站上下载的JSP图形编程(3)
💻 JAVA
字号:
import java.awt.Graphics;

/*
 * Created on Jul 3, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */

/**
 * @author Fabian Jones AD Summer Intern 2003
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class RainDrop{
	protected int x, y, velocity;
	private static int DELTA = 5;

	public RainDrop(int _x, int _y){
		this(_x, _y, 0);
	}
	
	public RainDrop(int _x, int _y, int _v){
		this.x = _x;
		this.y = _y;
		this.velocity = _v;
	}
	
	public void paint(Graphics g){
		g.drawLine(x, y, x+DELTA, y+DELTA);
		x = x + DELTA + velocity;
		y = y + DELTA + velocity;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -