package com.zhenzhigu.race; import java.awt.Point; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JLabel; /** * 马 * * @author loopcc create 20140514 * */ public class Horse extends JLabel implements Runnable { public int speed = 1;// 移动速度 public Icon icon = new ImageIcon("horse2.gif"); /** * 构造方法,指定坐标与速度 * * @param x * @param y * @param speed */ public Horse(int x, int y, int speed) { this.setBounds(x, y, 222, 222); this.speed = speed; this.setIcon(icon); new Thread(this).start();// 新开一个线程并启动 } // 实现Runnable接口中的run方法 // 每隔33毫秒移动一次 public void run() { Point p = null; while (true) { try { p = this.getLocation(); this.setLocation(p.x - speed, p.y); Thread.sleep(33); } catch (Exception e) { } } } }

佩恩六道 LV1
2023年6月16日
wyx065747 LV67
2022年5月7日
1357489915 LV1
2021年11月23日
尹恒yingying LV18
2021年11月11日
ysc123 LV5
2021年7月8日
lz397548123 LV6
2020年10月21日
薄夏earth LV1
2020年6月5日
666666liuliu LV1
2020年6月5日
小星星7592 LV1
2020年5月27日
2044079466 LV1
2019年11月14日

微信网友_6762641760833536
2023年12月4日
暂无贡献等级
佩恩六道 LV1
2023年6月16日
nh34546
2023年6月14日
暂无贡献等级
zyf4728890
2023年1月5日
暂无贡献等级
MoonSight LV1
2022年7月1日
微信网友_5992582549164032 LV6
2022年6月10日
liys1234 LV9
2022年4月25日
lyn520 LV3
2022年4月14日
zhendong LV7
2022年3月10日
枸杞七 LV3
2022年2月14日