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

📄 cell.java

📁 小游戏的代码。火影拼图的几种图案锻炼智力
💻 JAVA
字号:
package 小游戏;
import java.awt.Rectangle;
import javax.swing.Icon;
import javax.swing.JButton;

public class Cell extends JButton
{
  Cell(Icon icon)
  {
    super(icon);
    setSize(100, 100);
  }

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

⌨️ 快捷键说明

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