package index; import Anchor.anchor_Dell; import index.JPanelMoudle.ComMoudleComp; import index.JPanelMoudle.anchorListComp; import java.util.Timer; import java.util.TimerTask; public class Timer100 { Timer timer; int time=0; public void ding_shi_qi() { Integer cacheTime = 100;//触发器时间100毫秒执行一次 timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { try { time++; if (time==10){ if (ComMoudleComp.isChuankou()) { anchorListComp.getRowData(anchor_Dell.getAnchors()); }else { anchorListComp.updateTable();//清空信标列表 } time=0; } } catch (Exception e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } }, 100, cacheTime); } }