Issue with TimerTask
问题 Just have a look on this block of code: public Reminder() { a[0]=1000; a[1]=3000; a[2]=1000; a[3]=5000; timer = new Timer(); timer.schedule(new RemindTask(),0, a[i]); } ////////////////////// class RemindTask extends TimerTask { public void run() { point =point +arr[i].length(); doc.setCharacterAttributes(0,point+1, textpane.getStyle("Red"), true); i++; } } I want delay to be changed after each task,so the timings are stored in an array. When i++ is preformed(pointer to array),the timings are