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

📄 towerpoint.java

📁 自动演示搬运盘子
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package hannoi;/** * * @author Administrator */import java.awt.*;public class TowerPoint {    int x,y;    boolean 有盘子;    Disk 盘子=null;    HannoiTower con=null;    public TowerPoint(int x,int y,boolean boo)    {        this.x=x;        this.y=y;        有盘子=boo;    }    public boolean 是否有盘子()    {        return 有盘子;    }    public void set有盘子(boolean boo)    {        有盘子=boo;    }    public int getX()    {        return x;    }    public int getY()    {        return y;    }    public void 放置盘子(Disk 盘子,HannoiTower con)    {        this.con=con;        con.setLayout(null);        this.盘子=盘子;        con.add(盘子);        int w=盘子.getBounds().width;        int h=盘子.getBounds().height;        盘子.setBounds(x-w/2,y-h/2,w,h);        有盘子=true;        con.validate();    }    public Disk 获取盘子()    {        return 盘子;    }}

⌨️ 快捷键说明

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