void () { if (myScheduledFuture != null && !myScheduledFuture.isDone()) { myScheduledFuture.cancel(false); } myCalendar.setTimeInMillis(System.currentTimeMillis()); myScheduledFuture = EdtExecutorService.getScheduledExecutorInstance().schedule(myRepaintRunnable, 60 - myCalendar.get(SECOND), TimeUnit.SECONDS); }