If you put the rest of this method in a separate private method called paintBackgroundImage(g) you could get rid of the above comment and still clearly express your intent. For getting it done easy select the lines below in Eclipse and use Refactor -> Extract method. There are also useful shortcuts, under Windows alt+shift+M or also control+shift+V (they may differ under MacOS)