Do you have a repaint() method with your code in it? That is not normal and I don't know how it would work.
The call to the repaint() method will return without much delay. ...