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

📄 cell.java

📁 java编写的一款简单的拼图游戏
💻 JAVA
字号:
import javax.swing.Icon;
import javax.swing.JButton;
	
public class Cell extends JButton {
	Cell(Icon icon){//实际为ICON
		super(icon);
		this.setSize(100,100);
	}

	public void move(String direction,int sleep){//方格的移动
		if(direction=="UP"){
			this.setLocation(this.getBounds().x,this.getBounds().y-100);
		}else if(direction=="DOWN"){
			this.setLocation(this.getBounds().x,this.getBounds().y+100);
		}else if(direction=="LEFT"){
			this.setLocation(this.getBounds().x-100,this.getBounds().y);
		}else{
			this.setLocation(this.getBounds().x+100,this.getBounds().y);
		}
	}
	
}

⌨️ 快捷键说明

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