dan.java.txt

来自「该文件是用java开发工具编写的小型java源程序」· 文本 代码 · 共 39 行

TXT
39
字号
---------------------------Dan.java------------------------------------

import java.awt.*;
public class Dan extends Thread
{
	int x,y;
	Frame f;
	
	boolean b=true;
	Button d;
	
	public Dan(int x,int y,Frame f)
	{
		d=new Button();
		this.f=f;
		this.x=x+10;
		this.y=y;
		d.setBounds(this.x,this.y,5,5);
		this.f.add(d);
		this.start();
	}
	
	public void run()
	{
		while(b==true)
		{
			try
			{
				this.y-=10;
				if(y<0)
					b=false;
				d.setBounds(this.x,this.y,5,5);
				
				Thread.sleep(100);
			}
			catch(Exception e){}
		}
	}
}

⌨️ 快捷键说明

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