摘要: javax.swing.Timer类在创建时需要指定时间间隔和定时器到时间需要执行的动作,即ActionListener。1 Timer timer = new Timer(100, taskPerformer);2 timer.start(); 动画效果需要有连续的图画作为动作的播出效果,然后利用index = (index + 1)%imageCounts;来实现循环播放的效果。例如,1 private ActionListener taskPerformer = new ActionListener() {2 @Override3 public vo... 阅读全文
posted @ 2014-03-14 19:08 life91 阅读(1725) 评论(0) 推荐(0) 编辑