一 图片跟着鼠标移动,鼠标隐藏 int x,y; addMouseMotionListener(this);//设置鼠标监听 public void paint(Graphics g) { g.drawImage(GetImage.getImage("image/bg.jpg"),0,0,null); g.drawImage(GetImage.getImage("image/plane.png"),x,y,null);//替换的图片 } public void…
第一种方法,就是list中对象实现Comparable接口,代码如下: public class Person implements Comparable<Person> { private String name; private Integer order; /** * @return the name */ public String getName() { return name; } /** * @param name * the name to set */ public void…