You cannot reference the JDraw class. Instead, you should use an object. The object in your case is window . So use:
window.repaint();
This is how to say: βMan,β go to the door. Man is a class. You cannot tell the Man to do something, you need a copy of the Man, for example, Obama or Santa Claus. In your case: you cannot specify JDraw to redraw, but an object of type JDraw, i.e.: window .
source share