Also get rid of the call to getGraphics and to paint. The call to repaint will automatically cause a call to be made to your paint method with a Graphics object.