void () { myQueue.cancelAllUpdates(); myQueue.queue(new Update("update") { @Override public void run() { update(myPainter); if (myPainter.isModified()) { myScrollBar.invalidate(); myScrollBar.repaint(); } } }); }